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

Changed type hinting for handler function #1

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Ariel2400
Copy link
Owner

Due to changes introduced in apache#36205, we experienced breakage in our SQLExecuteQueryOperator. In short, our assumption was that the handler is able to also transform the data type returned from the query. For example our handler looked something like this:

def custom_handler(cursor):
    results = fetch_all_handler(cursor)
    columns = [column[0] for column in cursor.description]
     result_dicts = [dict(zip(columns, record)) for record in results]
     return [SomeDataclass(col_a=d[“COL_A”]

As that was changed, that led to errors in our dags. We now moved to use the _process_output method as we should’ve done in the first place, but we this type hint will prevent further confusion as to what are the constraints of the handler passed to the operator.

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.

2 participants