Replies: 9 comments
-
Thanks for opening your first issue here! Be sure to follow the issue template! |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
I think this is expected. Also: This seems more a feature request to vertical-python |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Hi there, I'have the same issue. Did I made some mistake? Do I need to split my queries in many vertica_operator? |
Beta Was this translation helpful? Give feedback.
-
Yes, or use my code above in a subclass of VerticaOperator with overriden |
Beta Was this translation helpful? Give feedback.
-
If there is an actual suggestion how to handle this on Airflow side - Please open a PR |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions