Skip to content

Move download_file to notebook connector #310

@ArBridgeman

Description

@ArBridgeman

In exasol/ai-lab#449, a new method was introduced into exasol/ds/sandbox/runtime/ansible/roles/jupyter/files/notebook/pyexasol/roundtrip_import_and_export.ipynb. This should be instead added into the utilities of the notebook-connector, as it's likely to be needed in other areas. Testing should also be added for it.

Create the follow up task in the ai-lab to update exasol/ds/sandbox/runtime/ansible/roles/jupyter/files/notebook/pyexasol/roundtrip_import_and_export.ipynb to the new function's usage.

import requests

def download_file(url, filename):
    try:
        response = requests.get(url, stream=True)
        response.raise_for_status()
        
        with open(filename, 'wb') as f:
            for chunk in response.iter_content(chunk_size=8192):
                f.write(chunk)
                
        print("File downloaded successfully!")
        
    except requests.exceptions.RequestException as e:
        print(f"Error downloading file: {str(e)}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureProduct feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions