question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please consider renaming function airflow.utils.dag_cycle_tester.test_cycle to check_cycle

See original GitHub issue

Description

function test_cycle will be collected by pytest if this function is imported in a user-defined test. Such an error will be emitted as pytest will treat it as a test.

test setup failed
file /opt/conda/lib/python3.8/site-packages/airflow/utils/dag_cycle_tester.py, line 27
  def test_cycle(dag):
E       fixture 'dag' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

Use case / motivation This can be simply “fixed” by renaming this function to check_cycle although the user can do it upon importing this function. This change by airflow will reduce the amount of surprise received by the end-user, and save a large number of debugging hours.

Are you willing to submit a PR? The changeset is too small to worth the trouble for a PR.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
zhangyi-hucommented, Jun 23, 2021

Sure, give it to me : )

On Wed, Jun 23, 2021, 7:30 AM Jarek Potiuk @.***> wrote:

Yeah @zhangyi-hu https://github.com/zhangyi-hu, it would be great you make PR. PR is a must as @uranusjr https://github.com/uranusjr mentioned. This change is probably not worth creating issue though, but PR is most welcome. Shall I assign it to you @zhangyi-hu https://github.com/zhangyi-hu ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/airflow/issues/16608#issuecomment-866757953, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH5ZCJDEBRAYU5AU6WFO4DTUHAUDANCNFSM47EZENQA .

0reactions
potiukcommented, Jun 23, 2021

Don’t. Just deprecate. We are very strictly following SemVer as of 2.0 and it will get dropped at 3.0 (but this is a given): https://github.com/apache/airflow/blob/main/README.md#semantic-versioning

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can we validated whether there are no cycles in the DAG ...
Due to the conflicts caused by having a function with "test" in the name, Airflow team renamed the function to check_cycle.
Read more >
Configuration Reference — Airflow Documentation
Configuration Reference¶. This page contains the list of all the available Airflow configurations that you can set in airflow.cfg file or using environment ......
Read more >
airflow.utils.dag_parsing_context — Airflow Documentation
class airflow.utils.dag_parsing_context. ... values are not None, they will contain the specific DAG and Task ID that Airflow is requesting to execute.
Read more >
Source code for airflow.models.dag
[docs]class InconsistentDataInterval(AirflowException): """Exception raised when a model populates data interval fields incorrectly.
Read more >
DAGs — Airflow Documentation
A DAG (Directed Acyclic Graph) is the core concept of Airflow, collecting Tasks together, organized with dependencies and relationships to say how they ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found