You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jscheffl (via GitHub)" <gi...@apache.org> on 2024/08/26 19:28:37 UTC
[PR] Remove deprecations in airflow.models.dag [airflow]
jscheffl opened a new pull request, #41774:
URL: https://github.com/apache/airflow/pull/41774
Code cleanup and removal of deprecations in `airflow.models.dag`
--
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: [PR] Remove deprecations in airflow.models.dag [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #41774:
URL: https://github.com/apache/airflow/pull/41774#discussion_r1732888045
##########
airflow/models/dag.py:
##########
@@ -852,52 +805,17 @@ def update_old_perm(permission: str):
updated_access_control[role][permissions.RESOURCE_DAG] = set(perms)
else:
updated_access_control[role] = perms
- if permissions.RESOURCE_DAG in updated_access_control[role]:
- updated_access_control[role][permissions.RESOURCE_DAG] = {
- update_old_perm(perm)
- for perm in updated_access_control[role][permissions.RESOURCE_DAG]
- }
elif isinstance(perms, dict):
# Not allow new access control format with old FAB versions
raise AirflowException(
"Please upgrade the FAB provider to a version >= 1.3.0 to allow "
"use the Dag Level Access Control new format."
)
else:
- updated_access_control[role] = {update_old_perm(perm) for perm in perms}
+ updated_access_control[role] = set(perms)
return updated_access_control
- def following_schedule(self, dttm):
Review Comment:
Just leaving a comment here so that it's not accidentally merged.
--
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: [PR] Remove deprecations in airflow.models.dag [airflow]
Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on code in PR #41774:
URL: https://github.com/apache/airflow/pull/41774#discussion_r1735297071
##########
airflow/models/dag.py:
##########
@@ -852,52 +805,17 @@ def update_old_perm(permission: str):
updated_access_control[role][permissions.RESOURCE_DAG] = set(perms)
else:
updated_access_control[role] = perms
- if permissions.RESOURCE_DAG in updated_access_control[role]:
- updated_access_control[role][permissions.RESOURCE_DAG] = {
- update_old_perm(perm)
- for perm in updated_access_control[role][permissions.RESOURCE_DAG]
- }
elif isinstance(perms, dict):
# Not allow new access control format with old FAB versions
raise AirflowException(
"Please upgrade the FAB provider to a version >= 1.3.0 to allow "
"use the Dag Level Access Control new format."
)
else:
- updated_access_control[role] = {update_old_perm(perm) for perm in perms}
+ updated_access_control[role] = set(perms)
return updated_access_control
- def following_schedule(self, dttm):
Review Comment:
Just to be onthe safe side, briefly re-based and want to see it green (again) before merge
--
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: [PR] Remove deprecations in airflow.models.dag [airflow]
Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on code in PR #41774:
URL: https://github.com/apache/airflow/pull/41774#discussion_r1735296412
##########
airflow/models/dag.py:
##########
@@ -852,52 +805,17 @@ def update_old_perm(permission: str):
updated_access_control[role][permissions.RESOURCE_DAG] = set(perms)
else:
updated_access_control[role] = perms
- if permissions.RESOURCE_DAG in updated_access_control[role]:
- updated_access_control[role][permissions.RESOURCE_DAG] = {
- update_old_perm(perm)
- for perm in updated_access_control[role][permissions.RESOURCE_DAG]
- }
elif isinstance(perms, dict):
# Not allow new access control format with old FAB versions
raise AirflowException(
"Please upgrade the FAB provider to a version >= 1.3.0 to allow "
"use the Dag Level Access Control new format."
)
else:
- updated_access_control[role] = {update_old_perm(perm) for perm in perms}
+ updated_access_control[role] = set(perms)
return updated_access_control
- def following_schedule(self, dttm):
Review Comment:
Other PR is merged now, so safe for this one as well
--
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: [PR] Remove deprecations in airflow.models.dag [airflow]
Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl merged PR #41774:
URL: https://github.com/apache/airflow/pull/41774
--
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