Prajwal7842 commented on code in PR #59938:
URL: https://github.com/apache/airflow/pull/59938#discussion_r2654835466
##########
airflow-core/src/airflow/models/pool.py:
##########
@@ -36,6 +37,23 @@
from sqlalchemy.sql import Select
+def validate_pool_name(name: str) -> None:
+ """
+ Validate that pool name only contains valid characters for stats reporting.
+
+ Pool names must only contain ASCII alphabets, numbers, underscores, dots,
and dashes
+ to ensure compatibility with stats naming requirements.
+
+ :param name: The pool name to validate
+ :raises ValueError: If the pool name contains invalid characters
+ """
+ if not re.match(r"^[a-zA-Z0-9_.-]+$", name):
Review Comment:
Just a thought : Do we need this additional validation method ? Is it
possible to refactor a code a bit and use the same validation logic used while
reporting stats ?
Else, any new validation rule would have to be updated here
--
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]