astro-sdk icon indicating copy to clipboard operation
astro-sdk copied to clipboard

File object should work event without filetype param

Open pankajastro opened this issue 1 year ago • 1 comments

Describe the bug If I'm passing a folder path URI in File object it throws error

Broken DAG: [/usr/local/airflow/dags/task_flow.py] Traceback (most recent call last):
  File "/usr/local/airflow/astro_sdk/src/astro/files/types/__init__.py", line 25, in create_file_type
    filetype = get_filetype(path)
  File "/usr/local/airflow/astro_sdk/src/astro/files/types/__init__.py", line 53, in get_filetype
    raise ValueError(
ValueError: Missing file extension, cannot automatically determine filetype from path 'gs://pankaj_test_dtt/'. Please pass the 'filetype' param with the explicit filetype (e.g. csv, ndjson, etc.).

Version

  • Astro: [e.g. 0.6.0]
  • OS: [eg. Debian]

To Reproduce Steps to reproduce the behavior:

  1. Write the DAG '...'
  2. Create connection '....'
  3. Run using '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

pankajastro avatar Aug 12 '22 12:08 pankajastro

Discussion: https://github.com/astronomer/astro-sdk/pull/596#discussion_r943415100

pankajastro avatar Aug 12 '22 18:08 pankajastro

duplicate https://github.com/astronomer/astro-sdk/issues/644

utkarsharma2 avatar Sep 02 '22 06:09 utkarsharma2