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

Clean up JenkinsJobTriggerOperator #19019

Merged
merged 6 commits into from
Dec 20, 2021
Merged

Clean up JenkinsJobTriggerOperator #19019

merged 6 commits into from
Dec 20, 2021

Conversation

xinbinhuang
Copy link
Contributor

@xinbinhuang xinbinhuang commented Oct 15, 2021

  • Remove some dead code because both jenkins_connection_id and job_name are positional args on the constructor
  • Match type ParamType to default arg

^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, 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 UPDATING.md.

@xinbinhuang xinbinhuang changed the title Remove dead code path from JenkinsJobTriggerOperator Clean up JenkinsJobTriggerOperator Oct 15, 2021
Comment on lines 133 to 136
# Since params can be either JSON string, dictionary, or list,
# check type and pass to build_job_url
if params and isinstance(params, str):
params = ast.literal_eval(params)
Copy link
Contributor Author

@xinbinhuang xinbinhuang Oct 16, 2021

Choose a reason for hiding this comment

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

Removing this will cause a small backward incompatibility if a user somehow use a str to represent either dict or list. So I'm happy to leave it as it's. Let me know if you want me keep it.

i.e.

import ast
import json


assert isinstance(ast.literal_eval(json.dumps({"param":1})), dict)
assert isinstance(ast.literal_eval(json.dumps([("param", "1")])), list)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should retain the conversion for backward compatibility

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! Keep the compatibility

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Dec 3, 2021
@xinbinhuang xinbinhuang removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Dec 4, 2021
@xinbinhuang
Copy link
Contributor Author

@ephraimbuddy ptal

Copy link
Contributor

@ephraimbuddy ephraimbuddy left a comment

Choose a reason for hiding this comment

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

LGTM.

@github-actions
Copy link

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Dec 16, 2021
@xinbinhuang xinbinhuang merged commit 85bedd0 into main Dec 20, 2021
@eladkal eladkal deleted the xinbinhuang-patch-1 branch March 29, 2022 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers okay to merge It's ok to merge this PR as it does not require more tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants