You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "taylorterwin (via GitHub)" <gi...@apache.org> on 2023/09/28 22:18:14 UTC
[GitHub] [airflow] taylorterwin opened a new issue, #34676: 'cause' key need to be limited to 255 characters to avoid failures due to trigger_reason field
taylorterwin opened a new issue, #34676:
URL: https://github.com/apache/airflow/issues/34676
### Apache Airflow version
2.7.1
### What happened
In the dbt Airflow provider code (referenced below), a field called trigger_reason is mapped to the JSON cause key:value pair, that you would directly set in Postman.
When trigger_reason is not set in Airflow (None) it defaults to creating a calculated string:
```
```
if self.trigger_reason is None:
self.trigger_reason = (
f"Triggered via Apache Airflow by task {self.task_id!r} in the {self.dag.dag_id} DAG."
)
```
I'm going to guess that in this case, the trigger_reason isn't set in the airflow task, and therefore the task_id and the dag_id are both so long (?) that they are causing this calculated string to exceed 255 characters.
That being said, we should handle this better and truncate it at 254 regardless.
code is here:
https://airflow.apache.org/docs/apache-airflow-providers-dbt-cloud/3.3.0/_modules/airflow/providers/dbt/cloud/operators/dbt.html
### What you think should happen instead
Basically the summary is that on this line;
https://github.com/apache/airflow/blob/bd512007e531bb58e86f8c1b8f84ac20e8e92d7c/airflow/providers/dbt/cloud/operators/dbt.py#L132
`cause ` needs to be limited to 255 characters
### How to reproduce
the trigger_reason creating a calculate string
def trigger_job_run(
self,
job_id: int,
cause: str,
account_id: Optional[int] = None,
steps_override: Optional[List[str]] = None,
schema_override: Optional[str] = None,
additional_run_config: Optional[Dict[str, Any]] = None,
) -> Response:
"""
Triggers a run of a dbt Cloud job.
:param job_id: The ID of a dbt Cloud job.
:param cause: Description of the reason to trigger the job.
[2023-09-26, 08:47:38 EDT] {{http.py:161}} ERROR - HTTP error: Bad Request
[2023-09-26, 08:47:38 EDT] {{http.py:162}} ERROR - {"status":{"code":400,"is_success":false,"user_message":"The request was invalid. Please double check the provided data and try again.","developer_message":""},"data":{"cause":"must be between 0 and 255 characters"}}
### Operating System
unknown
### Versions of Apache Airflow Providers
_No response_
### Deployment
Official Apache Airflow Helm Chart
### Deployment details
_No response_
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] 'cause' key need to be limited to 255 characters to avoid failures due to trigger_reason field [airflow]
Posted by "josh-fell (via GitHub)" <gi...@apache.org>.
josh-fell closed issue #34676: 'cause' key need to be limited to 255 characters to avoid failures due to trigger_reason field
URL: https://github.com/apache/airflow/issues/34676
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uroy-personal commented on issue #34676: 'cause' key need to be limited to 255 characters to avoid failures due to trigger_reason field
Posted by "uroy-personal (via GitHub)" <gi...@apache.org>.
uroy-personal commented on issue #34676:
URL: https://github.com/apache/airflow/issues/34676#issuecomment-1740258491
//assign
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] 'cause' key need to be limited to 255 characters to avoid failures due to trigger_reason field [airflow]
Posted by "boraberke (via GitHub)" <gi...@apache.org>.
boraberke commented on issue #34676:
URL: https://github.com/apache/airflow/issues/34676#issuecomment-2046698305
Hi @uroy-personal, if you have stopped working on this issue, I can take over.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] 'cause' key need to be limited to 255 characters to avoid failures due to trigger_reason field [airflow]
Posted by "uroy-personal (via GitHub)" <gi...@apache.org>.
uroy-personal commented on issue #34676:
URL: https://github.com/apache/airflow/issues/34676#issuecomment-1754254509
This change is in progress. Will raise the PR soon for review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] 'cause' key need to be limited to 255 characters to avoid failures due to trigger_reason field [airflow]
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on issue #34676:
URL: https://github.com/apache/airflow/issues/34676#issuecomment-2027984316
@uroy-personal are you still working on this issue?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] 'cause' key need to be limited to 255 characters to avoid failures due to trigger_reason field [airflow]
Posted by "uroy-personal (via GitHub)" <gi...@apache.org>.
uroy-personal commented on issue #34676:
URL: https://github.com/apache/airflow/issues/34676#issuecomment-2030917892
Hi @eladkal ,
I worked on this and then lost track due to few issues on my side. I will finish it hopefully by this week. Is that okay?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] 'cause' key need to be limited to 255 characters to avoid failures due to trigger_reason field [airflow]
Posted by "uroy-personal (via GitHub)" <gi...@apache.org>.
uroy-personal commented on issue #34676:
URL: https://github.com/apache/airflow/issues/34676#issuecomment-2046962646
Hi @boraberke ,
Yes you can take over. I am unassigning myself. Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] boring-cyborg[bot] commented on issue #34676: 'cause' key need to be limited to 255 characters to avoid failures due to trigger_reason field
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #34676:
URL: https://github.com/apache/airflow/issues/34676#issuecomment-1740074049
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] eladkal commented on issue #34676: 'cause' key need to be limited to 255 characters to avoid failures due to trigger_reason field
Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on issue #34676:
URL: https://github.com/apache/airflow/issues/34676#issuecomment-1740171355
cc @josh-fell
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org