-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Fix: JiraOperator support any return response from Jira client #31672
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
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
hussein-awala
left a comment
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 wonder if we should just activate the advanced mode to get the raw response from the different methods which is a dict:
https://github.com/atlassian-api/atlassian-python-api/blob/0497b617916274b8aa3677265540b0fd06196663/atlassian/rest_client.py#L214
|
I just gave it a try, but that doesn't work: When See the rest api methods like post, get, put, ... of the AtlassianRestAPI object: without advanced mode, we get a dict via the Looking further in the Jira client, they are some methods that just return something else than a dict:
And actually, are those lines (79-80) even needed ? I suggest to merge this PR, so that the JiraOperator is usable. I'll continue to explore the Jira API, and will later create other PR with correct tests case. And maybe at that point we can discuss a better xcom.push ? What do you think ? |
7134926 to
1bf01b0
Compare
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Hello,
The JiraOperator fails when using methods that returns any other thing than a dict. This PR fix it by checking whenever a dict is returned.
Example issue
The
get_project_issues_countmethod returns the number of issues in a project, asint.However, the current implementation of the JiraOperator expect a dict as response, to perform a
geton it.Thus, the above code will fail, throwing the following:
Solution
Check if it's a dict prior to performing a
geton the returned value.^ 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.rstor{issue_number}.significant.rst, in newsfragments.