Skip to content
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

Fix transform_file to not depend on transform decorator #1004

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

feluelle
Copy link
Member

@feluelle feluelle commented Oct 6, 2022

Description

What is the current behavior?

Currently, the transform_file is using the transform decorator underneath which has a few limitations. For more information check out the issue below.

closes: #892

What is the new behavior?

  • use TransformOperator in transform_file
  • set default task_id for TransformOperator to "transform"
  • fix example for transform_file
  • resolve XComArgs when finding first table
  • add parameters to template_fields

Does this introduce a breaking change?

No.

Checklist

  • Created tests which fail without the change (if possible)
  • Extended the README / documentation, if necessary

@codecov
Copy link

codecov bot commented Oct 7, 2022

Codecov Report

Base: 93.38% // Head: 83.06% // Decreases project coverage by -10.32% ⚠️

Coverage data is based on head (e8892cf) compared to base (146573c).
Patch has no changes to coverable lines.

❗ Current head e8892cf differs from pull request most recent head 240ba2b. Consider uploading reports for the commit 240ba2b to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1004       +/-   ##
===========================================
- Coverage   93.38%   83.06%   -10.33%     
===========================================
  Files          57        7       -50     
  Lines        2374      124     -2250     
  Branches      266       13      -253     
===========================================
- Hits         2217      103     -2114     
+ Misses        110       17       -93     
+ Partials       47        4       -43     
Impacted Files Coverage Δ
...thon-sdk/src/astro/sql/operators/base_decorator.py
python-sdk/src/astro/sql/operators/dataframe.py
python-sdk/src/astro/sql/operators/transform.py
python-sdk/src/astro/utils/table.py
python-sdk/src/astro/databases/google/bigquery.py
python-sdk/src/astro/utils/task_id_helper.py
python-sdk/src/astro/sql/table.py
python-sdk/src/astro/databases/snowflake.py
python-sdk/src/astro/databases/base.py
python-sdk/src/astro/databases/__init__.py
... and 40 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@feluelle feluelle force-pushed the fix/transform-file branch 2 times, most recently from 37be9da to f442d03 Compare October 11, 2022 11:56
@feluelle feluelle added this to the 1.2.0 milestone Oct 11, 2022
@feluelle feluelle marked this pull request as draft October 11, 2022 15:49
- use TransformOperator in transform_file
- set default task_id for TransformOperator to "transform"
- fix example for transform_file
- resolve XComArgs when finding first table
- add parameters to template_fields
@feluelle feluelle marked this pull request as ready for review October 11, 2022 16:19
@feluelle feluelle merged commit cf46de5 into main Oct 11, 2022
@feluelle feluelle deleted the fix/transform-file branch October 11, 2022 16:43
tatiana added a commit that referenced this pull request Feb 6, 2023
)

Allow users to view the SQL statements, regardless of whether they are part of the DAG definition or declared on a separate file, within the Airflow UI task "Rendered Template" field. 

This change affects `aql.transform`, `aql.transform_file` and `aql.dataframe`, since it is implemented on the `BaseSQLDecoratedOperator`.

The following changes were made:
- add sql and parameters to BaseSQLDecoratedOperator template_fields
- add .sql to BaseSQLDecoratedOperator template_ext
- add check for template_fields and template_ext

closes: #1003 
depends on: #1004 

Co-authored-by: Tatiana Al-Chueyr <tatiana.alchueyr@gmail.com>
utkarsharma2 pushed a commit that referenced this pull request Feb 8, 2023
)

Allow users to view the SQL statements, regardless of whether they are part of the DAG definition or declared on a separate file, within the Airflow UI task "Rendered Template" field. 

This change affects `aql.transform`, `aql.transform_file` and `aql.dataframe`, since it is implemented on the `BaseSQLDecoratedOperator`.

The following changes were made:
- add sql and parameters to BaseSQLDecoratedOperator template_fields
- add .sql to BaseSQLDecoratedOperator template_ext
- add check for template_fields and template_ext

closes: #1003 
depends on: #1004 

Co-authored-by: Tatiana Al-Chueyr <tatiana.alchueyr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make transform_file not depend on the transform decorator
4 participants