ashb commented on a change in pull request #19257:
URL: https://github.com/apache/airflow/pull/19257#discussion_r741843358
##########
File path: airflow/models/dag.py
##########
@@ -368,8 +369,11 @@ def __init__(
DeprecationWarning,
stacklevel=2,
)
-
- validate_key(dag_id)
+
+ if not is_ascii(dag_id):
+ # slugify dag id
+ dag_id = slugify(dag_id, lowercase=False)
Review comment:
https://docs.python.org/3/library/stdtypes.html?highlight=isidentifier#str.isidentifier
is probably of use here.
##########
File path: airflow/models/dag.py
##########
@@ -368,8 +369,11 @@ def __init__(
DeprecationWarning,
stacklevel=2,
)
-
- validate_key(dag_id)
+
+ if not is_ascii(dag_id):
+ # slugify dag id
+ dag_id = slugify(dag_id, lowercase=False)
Review comment:
https://docs.python.org/3/library/stdtypes.html?highlight=isidentifier#str.isidentifier
is probably of use here.
```python console
>>> str.isidentifier('dag_你好_cześć')
True
```
##########
File path: airflow/models/dag.py
##########
@@ -368,8 +369,11 @@ def __init__(
DeprecationWarning,
stacklevel=2,
)
-
- validate_key(dag_id)
+
+ if not is_ascii(dag_id):
+ # slugify dag id
+ dag_id = slugify(dag_id, lowercase=False)
Review comment:
https://docs.python.org/3/library/stdtypes.html?highlight=isidentifier#str.isidentifier
is probably of use here.
```python console
>>> str.isidentifier('dag_你好_cześć')
True
```
(Though isidentifer doesn't allow `-`)
##########
File path: airflow/models/dag.py
##########
@@ -368,8 +369,11 @@ def __init__(
DeprecationWarning,
stacklevel=2,
)
-
- validate_key(dag_id)
+
+ if not is_ascii(dag_id):
+ # slugify dag id
+ dag_id = slugify(dag_id, lowercase=False)
Review comment:
https://docs.python.org/3/library/stdtypes.html?highlight=isidentifier#str.isidentifier
is probably of use here.
##########
File path: airflow/models/dag.py
##########
@@ -368,8 +369,11 @@ def __init__(
DeprecationWarning,
stacklevel=2,
)
-
- validate_key(dag_id)
+
+ if not is_ascii(dag_id):
+ # slugify dag id
+ dag_id = slugify(dag_id, lowercase=False)
Review comment:
https://docs.python.org/3/library/stdtypes.html?highlight=isidentifier#str.isidentifier
is probably of use here.
```python console
>>> str.isidentifier('dag_你好_cześć')
True
```
##########
File path: airflow/models/dag.py
##########
@@ -368,8 +369,11 @@ def __init__(
DeprecationWarning,
stacklevel=2,
)
-
- validate_key(dag_id)
+
+ if not is_ascii(dag_id):
+ # slugify dag id
+ dag_id = slugify(dag_id, lowercase=False)
Review comment:
https://docs.python.org/3/library/stdtypes.html?highlight=isidentifier#str.isidentifier
is probably of use here.
```python console
>>> str.isidentifier('dag_你好_cześć')
True
```
(Though isidentifer doesn't allow `-`)
--
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]