-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Logging and returning info about query execution SnowflakeHook #15736
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
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
|
I guess we can also add it as value returned by SnowflakeOperator's execute method ? It's backwards compatible, and with do_xcom_push = True (default) it will automatically create XCom with the output. Might be really useful. |
Done :) Edit: it seems that the test of the XCom is failing Any idea how to solve it? Thanks |
|
It means the value you want to push cannot be serialised into JSON. What is the value that caused the failure? |
|
Seems that execution_info are "rows" returned by Cursor which is not json-serializable. This PyMSQL shows an example how you can do it: https://programmersought.com/article/12771376188/ |
I made a workaround eventually. The real output is a list of dicts, so it is serializable with real data. The error was due to the mocking I think. Everything green now, I hope it can be merged soon |
I see. Yeah . Plausible. |
This modification will log useful info about the execution. Some examples are:
Also, these values are returned so that we can further implement behavior modifications in the Operators. For instance, in S3ToSnowflakeOperator, if the status is
Copy executed with 0 files processed we could raise an errorI think new tests are not necessary since it just logs more info and returns a value