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

Added output_processor parameter to SQLQueryOperator and fixed bug with return_single_query_results handler when None is passed as split_statements #44781

Merged

Conversation

dabla
Copy link
Contributor

@dabla dabla commented Dec 9, 2024

Added output_processor parameter to SQLQueryOperator to allow customizing return of results as by default descriptions get ignored. This parameter allows us to customized that if needed.

Also fixed an issue with the return_single_query_results handler method when None is passed as split_statements, which wasn't allowed in the handler method but is for the split_statements parameter in the SQLQueryOperator.


^ 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.

@dabla dabla requested a review from eladkal as a code owner December 9, 2024 07:46
@eladkal eladkal changed the title Added output_processor parameter to SQLQueryOperator Added output_processor parameter to BaseSQLOperator Dec 9, 2024
@potiuk
Copy link
Member

potiuk commented Dec 9, 2024

Nice. But tests have to pass :)

@dabla dabla changed the title Added output_processor parameter to BaseSQLOperator Added output_processor parameter to SQLQueryOperator and fixed bug with return_single_query_results handler when None is passed as split_statements Dec 9, 2024
@dabla
Copy link
Contributor Author

dabla commented Dec 9, 2024

Nice. But tests have to pass :)

Yeah, that's when I discovered the bug in the return_single_query_results handler method.
Don't know if the fix will be approved, we could do it the way around and force the split_statements parameter not to be None in the SQLQueryOperator. So that's up to you guys ;-)

@potiuk potiuk merged commit bb259ea into apache:main Dec 9, 2024
65 checks passed
LefterisXefteris pushed a commit to LefterisXefteris/airflow that referenced this pull request Jan 5, 2025
…th return_single_query_results handler when None is passed as split_statements (apache#44781)

* refactor: Added output_processor parameter to SQLQueryOperator

* refactor: Reformatted SQLQueryOperator

* refactor: Fixed return_single_query_results when none is passed as split_statements

* refactor: Reformatted SQLExecuteOperator

* refactor: Added white line

---------

Co-authored-by: David Blain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants