cbuffett commented on issue #18010:
URL: https://github.com/apache/airflow/issues/18010#issuecomment-2008133854
I'm seeing a very similar error when the stat name is too long (more than
250 characters) in Airflow 2.7.2 (masked due to sensitive data)
```
[2024-03-08, 13:49:12 UTC] {validators.py:101} ERROR - Invalid stat name:
***************************************************************************************************************************************************************************************************************************************************************.
Traceback (most recent call last):
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py",
line 1518, in _run_raw_task
self._execute_task_with_callbacks(context, test_mode, session=session)
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py",
line 1642, in _execute_task_with_callbacks
with Stats.timer(f"dag.{self.task.dag_id}.{self.task.task_id}.duration",
tags=self.stats_tags):
AttributeError: __enter__
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/metrics/validators.py",
line 98, in wrapper
stat = handler_stat_name_func(stat)
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/metrics/validators.py",
line 181, in stat_name_default_handler
raise InvalidStatsNameException(
airflow.exceptions.InvalidStatsNameException: The stat_name
(***************************************************************************************************************************************************************************************************************************************************************)
has to be less than 250 characters.
```
What's interesting is that I see the stat name too long exception multiple
times in the logs, but only this instance results in the AttributeError.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]