-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExcelFileType class added #1978
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the contribution, @skolchin. It's looking great, including code, docs, and tests.
Minor comments in-line. I just enabled the tests, so we can confirm all the tests pass in the CI. Please, could you rebase this PR based on the latest main
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. But look like there is a conflict and would be great if we can add a test here if possible https://github.com/astronomer/astro-sdk/blob/main/python-sdk/tests/sql/operators/test_load_file.py
@pankajastro , when I run |
Hi @skolchin, from log you have shared it is difficult to say why it happening. but test work on the local machine. We have some integration tests that require more setup like credentials etc. I would suggest, maybe adding an airflow task here https://github.com/astronomer/astro-sdk/blob/main/python-sdk/example_dags/example_load_file.py would be great. We have everything in CI to run this
|
@skolchin do let us know if you need any support on this, looks like we are very close to merging it |
@pankajastro Hi, sorry, was buzy yesterday. Test added and it seems it works |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -0,0 +1,46 @@ | |||
from __future__ import annotations | |||
|
|||
import io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Just one thing - can we change the dir structure? if it's not too much trouble?
it can be something like:
python-sdk/src/astro/files/types/excel
python-sdk/src/astro/files/types/excel/base.py
python-sdk/src/astro/files/types/excel/xls.py
python-sdk/src/astro/files/types/excel/xlsx.py
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it but some test refactoring requires
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can do it as separate PR if needed
yield method_map_fixture( | ||
method=method, | ||
classes=classes, | ||
base_path=base_path, | ||
get=lambda x: FileType(x.rstrip(suffix).lower()), | ||
get=lambda x: FileType(x[0:-8].lower()), # remove FileType suffix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suffix = "FileType"
yield method_map_fixture(
method=method,
classes=classes,
base_path=base_path,
get=lambda x: FileType(x[0:-len(suffix)].lower()), # remove FileType suffix
Something like this would be better, compared to 0: -8
. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing all the feedback, @skolchin ! Looks great!
main branch is broken see CI https://github.com/astronomer/astro-sdk/actions/runs/5830707808/job/15812653210 I had added a ignore in #1978 but for quick merge creating separate PR
This is awesome, thanks @skolchin 👏 for creating the PR. Appreciate it. |
@pankajastro @tatiana thank you! |
New file type class (ExcelFileType) added to support operations on Excel files (see #1956)