Please consider renaming function airflow.utils.dag_cycle_tester.test_cycle to check_cycle
See original GitHub issueDescription
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:
- Created 2 years ago
- Comments:8 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure, give it to me : )
On Wed, Jun 23, 2021, 7:30 AM Jarek Potiuk @.***> wrote:
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