aritra24 commented on code in PR #61288:
URL: https://github.com/apache/airflow/pull/61288#discussion_r2759165799


##########
airflow-core/src/airflow/utils/download_utils.py:
##########
@@ -0,0 +1,101 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import logging
+import platform
+from pathlib import Path
+
+import requests
+
+log = logging.getLogger(__name__)
+
+
+def download_file_from_github(
+    version: str, output_file: Path, github_token: str | None = None, timeout: 
int = 60
+) -> bool:
+    """
+    Download a file from the GitHub repository of Mprocs using the GitHub API.
+
+    In case of any error different from 404, it will exit the process with 
error code 1.
+
+    :param version: version to download
+    :param output_file: Path where the file should be downloaded
+    :param github_token: GitHub token to use for authentication
+    :param timeout: timeout in seconds for the download request, default is 60 
seconds
+    :return: whether the file was successfully downloaded (False if the file 
is missing)
+    """
+    import requests
+
+    url = get_url_from_version(version=version)
+    if not url:

Review Comment:
   Ack, that makes sense. Let me do that! 



##########
airflow-core/src/airflow/utils/download_utils.py:
##########
@@ -0,0 +1,101 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import logging
+import platform
+from pathlib import Path
+
+import requests
+
+log = logging.getLogger(__name__)
+
+
+def download_file_from_github(
+    version: str, output_file: Path, github_token: str | None = None, timeout: 
int = 60
+) -> bool:
+    """
+    Download a file from the GitHub repository of Mprocs using the GitHub API.
+
+    In case of any error different from 404, it will exit the process with 
error code 1.
+
+    :param version: version to download
+    :param output_file: Path where the file should be downloaded
+    :param github_token: GitHub token to use for authentication
+    :param timeout: timeout in seconds for the download request, default is 60 
seconds
+    :return: whether the file was successfully downloaded (False if the file 
is missing)
+    """
+    import requests
+
+    url = get_url_from_version(version=version)
+    if not url:

Review Comment:
   Ack, that makes sense. Let me do that! 



##########
airflow-core/src/airflow/utils/download_utils.py:
##########
@@ -0,0 +1,101 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import logging
+import platform
+from pathlib import Path
+
+import requests
+
+log = logging.getLogger(__name__)
+
+
+def download_file_from_github(
+    version: str, output_file: Path, github_token: str | None = None, timeout: 
int = 60
+) -> bool:
+    """
+    Download a file from the GitHub repository of Mprocs using the GitHub API.
+
+    In case of any error different from 404, it will exit the process with 
error code 1.
+
+    :param version: version to download
+    :param output_file: Path where the file should be downloaded
+    :param github_token: GitHub token to use for authentication
+    :param timeout: timeout in seconds for the download request, default is 60 
seconds
+    :return: whether the file was successfully downloaded (False if the file 
is missing)
+    """
+    import requests
+
+    url = get_url_from_version(version=version)
+    if not url:

Review Comment:
   Ack, that makes sense. Let me do that! 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to