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 assignment of template field in __init__ in DataSyncOperator #36605

Merged
merged 3 commits into from
Jan 4, 2024

Conversation

romsharon98
Copy link
Collaborator

Related: #36484

Set default value for parameters.

cc: @shahar1


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Copy link
Member

@hussein-awala hussein-awala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a dict as a default value is not a good practice:

>>> def test(i, d={}):
...     d[i] = "something"
...     print(d)
... 
>>> test(1, d={})
{1: 'something'}
>>> test(2, d={})
{2: 'something'}
>>> test(1)
{1: 'something'}
>>> test(2)
{1: 'something', 2: 'something'}

airflow/providers/amazon/aws/operators/datasync.py Outdated Show resolved Hide resolved
airflow/providers/amazon/aws/operators/datasync.py Outdated Show resolved Hide resolved
romsharon98 and others added 2 commits January 5, 2024 00:52
Co-authored-by: Hussein Awala <hussein@awala.fr>
Co-authored-by: Hussein Awala <hussein@awala.fr>
@hussein-awala hussein-awala merged commit a877bde into apache:main Jan 4, 2024
51 checks passed
@romsharon98 romsharon98 deleted the fix/data-sync-operator branch January 5, 2024 06:01
abhishekbhakat pushed a commit to abhishekbhakat/my_airflow that referenced this pull request Mar 5, 2024
…pache#36605)

* set default values of parameters

* Update airflow/providers/amazon/aws/operators/datasync.py

Co-authored-by: Hussein Awala <hussein@awala.fr>

* Update airflow/providers/amazon/aws/operators/datasync.py

Co-authored-by: Hussein Awala <hussein@awala.fr>

---------

Co-authored-by: Hussein Awala <hussein@awala.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers provider:amazon-aws AWS/Amazon - related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants