-
Notifications
You must be signed in to change notification settings - Fork 14.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
VerticaOperator exception handling #11476
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
I also created an issue in vertica-python repo some time ago, but I think this is not a bug in vertica-python, since there is a way to produce the exceptions. |
I think this is expected. Also: This seems more a feature request to vertical-python |
This is expected in vertica-python because there is a way to actually retrieve the exceptions by using it properly. But not in Airflow: now the operator works "fire-and-forget"-style so you don't know if anything went wrong. Since one the purposes of Airflow is knowing the state of you tasks and automatically taking the necessary actions (retrying a task or skipping downstream tasks), this seems like a bug or at least unexpected behavior (of Airflow) to me. Maybe I'm wrong about this, or maybe I'm right, but the maintainers would consider this a breaking change. But I think it should be discussed further at least. |
I have no strong feeling here I just say that in my opinion it's better to address this by PR in vertica-python for a way to execute the code and if exception raised then actually raise it. When this functionality added to the lib it will be easier to expose it in the operator. You can always submit pull request to airflow and see if it will be accepted. |
Hi there, I'have the same issue. Did I made some mistake? Do I need to split my queries in many vertica_operator? |
Yes, or use my code above in a subclass of VerticaOperator with overriden |
If there is an actual suggestion how to handle this on Airflow side - Please open a PR |
Since there is a debate if this is an airflow issue or vertica issue and due to the fact that no one raised PR to address it I'm converting this issue to discussion. If anyone encounter this problem and has a code suggestion to Airflow - feel free to open PR directly. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Apache Airflow version:
1.10.10
Environment:
Docker on Linux (but it doesn't really matter here).
What happened:
VerticaOperator
usesvertica_python
. By default, if there are multiple statements in the query,vertica_python
will return only the first result set oncursor.fetchall()
and raise exceptions associated with this result set. E.g. a task running this query:executed by the operator will be marked as "Success" and won't show any exceptions in the logs. This is a minimal example of an exception, but the same goes for any error on the side of Vertica (most notably, constraint violations).
What you expected to happen:
All exceptions raised properly.
DAG:
Then run:
Result on my setup:
Fix ideas
Ideally, we should run some variation of this code either in the operator or in the hook:
I can create a PR, but the main question is whether this is expected behaviour (well, I expected it and spent quite some time figuring out where the problem is) and where the fix should go.
The text was updated successfully, but these errors were encountered: