Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common sql bugfixes and improvements #26761

Merged
merged 78 commits into from
Oct 26, 2022

Commits on Sep 27, 2022

  1. Fix BigQueryTableCheckOperator test

    Signed-off-by: Benji Lampel <benjamin@astronomer.io>
    denimalpaca committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    711d6bc View commit details
    Browse the repository at this point in the history
  2. Remove job_id generation in table/col check operators

    The job_id is automatically generated by hook.insert_job()
    if an empty string is passed, so job_id generation in the
    operator is removed in favor of the existing code.
    
    Signed-off-by: Benji Lampel <benjamin@astronomer.io>
    denimalpaca committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    3c97433 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2022

  1. Rework SQL query building

    SQL query building is moved to the init() method of the column
    and table check operators to lessen the amount of duplicate code
    in the child operator. It also has the added effect of, ideally,
    passing a more complete query to OpenLineage.
    
    In doing the above, the column check operator had to be reworked and
    now matches the logic of the table check operator in terms of
    returning multiple rows and only sending one query to the database.
    denimalpaca committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    11a26fd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    de7fafb View commit details
    Browse the repository at this point in the history
  3. Add option to fail check operators without retries

    Adds a new parameter, retry_on_failure, and a new function to
    determine if operators should retry or not on test failure.
    denimalpaca committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    b315f0b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a560b45 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2022

  1. Update airflow/providers/common/sql/operators/sql.py

    Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
    denimalpaca and uranusjr authored Sep 29, 2022
    Configuration menu
    Copy the full SHA
    8c987fd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4364a39 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    30839fb View commit details
    Browse the repository at this point in the history
  4. Update tests and operator code

    Updates tests to reflect changes in operator code, and fixed
    bugs in operators as well. Mainly moving the code to check for
    failed tests into the column and table check operators as it works
    slightly differently for each and doesn't make much sense as a
    top-level function.
    denimalpaca committed Sep 29, 2022
    Configuration menu
    Copy the full SHA
    a787d3a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9005a4b View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2022

  1. Configuration menu
    Copy the full SHA
    c00c934 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2022

  1. Fix BigQueryTableCheckOperator test

    Signed-off-by: Benji Lampel <benjamin@astronomer.io>
    denimalpaca committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    b2eb10a View commit details
    Browse the repository at this point in the history
  2. Remove job_id generation in table/col check operators

    The job_id is automatically generated by hook.insert_job()
    if an empty string is passed, so job_id generation in the
    operator is removed in favor of the existing code.
    
    Signed-off-by: Benji Lampel <benjamin@astronomer.io>
    denimalpaca committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    e13c59c View commit details
    Browse the repository at this point in the history
  3. Rework SQL query building

    SQL query building is moved to the init() method of the column
    and table check operators to lessen the amount of duplicate code
    in the child operator. It also has the added effect of, ideally,
    passing a more complete query to OpenLineage.
    
    In doing the above, the column check operator had to be reworked and
    now matches the logic of the table check operator in terms of
    returning multiple rows and only sending one query to the database.
    denimalpaca committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    708ad7a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    62c01bf View commit details
    Browse the repository at this point in the history
  5. Add option to fail check operators without retries

    Adds a new parameter, retry_on_failure, and a new function to
    determine if operators should retry or not on test failure.
    denimalpaca committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    f66bfe4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ef7c2a1 View commit details
    Browse the repository at this point in the history
  7. Update airflow/providers/common/sql/operators/sql.py

    Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
    denimalpaca and uranusjr committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    586dc39 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    419b167 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    55f9bb8 View commit details
    Browse the repository at this point in the history
  10. Update tests and operator code

    Updates tests to reflect changes in operator code, and fixed
    bugs in operators as well. Mainly moving the code to check for
    failed tests into the column and table check operators as it works
    slightly differently for each and doesn't make much sense as a
    top-level function.
    denimalpaca committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    e8ce879 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3e8dcd9 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    0ce4b6f View commit details
    Browse the repository at this point in the history
  13. Merge branch 'common_sql_bugfixes_and_improvements' of github.com:den…

    …imalpaca/airflow into common_sql_bugfixes_and_improvements
    denimalpaca committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    a7c5bd2 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2022

  1. Configuration menu
    Copy the full SHA
    bf54c24 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2022

  1. Configuration menu
    Copy the full SHA
    c3e64ea View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b1262e6 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2022

  1. Update operator logic and tests

    Adds "where" option in checks dictionaries for column and table
    operators, which may be renamed. This allows for check-level
    partitioning, whereas the partition_clause param will always be
    for all checks. New tests are added for this addition.
    denimalpaca committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    1a52335 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    62fc3e4 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'common_sql_bugfixes_and_improvements' of github.com:den…

    …imalpaca/airflow into common_sql_bugfixes_and_improvements
    denimalpaca committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    a60e3e0 View commit details
    Browse the repository at this point in the history
  4. Add testing for column check operator and line edits

    Cleans up operator and adds testing for new generator function.
    denimalpaca committed Oct 7, 2022
    Configuration menu
    Copy the full SHA
    46ca885 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2022

  1. Configuration menu
    Copy the full SHA
    2014f5e View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2022

  1. Configuration menu
    Copy the full SHA
    9014f65 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ee5f516 View commit details
    Browse the repository at this point in the history
  3. Edit operator docstring

    denimalpaca committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    bdccba7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    888160a View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2022

  1. Configuration menu
    Copy the full SHA
    fe8ba70 View commit details
    Browse the repository at this point in the history
  2. Updates from code review

    denimalpaca committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    3e159c0 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'common_sql_bugfixes_and_improvements' of github.com:den…

    …imalpaca/airflow into common_sql_bugfixes_and_improvements
    denimalpaca committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    c3214c2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    67c43c8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    37c704f View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2022

  1. Configuration menu
    Copy the full SHA
    6368a95 View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2022

  1. Configuration menu
    Copy the full SHA
    4b2fc34 View commit details
    Browse the repository at this point in the history
  2. Add new accept_none argument to column check operator

    The new argument, defaulting to true, will convert Nones returned
    from the query to 0s so numeric calculations can be performed
    correctly. This allows empty tables to be handled as a row of zeroes.
    
    Additional documentation is also supplied
    denimalpaca committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    9367ab9 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2022

  1. Configuration menu
    Copy the full SHA
    8745d53 View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2022

  1. Configuration menu
    Copy the full SHA
    84e4e01 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e46c233 View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2022

  1. Configuration menu
    Copy the full SHA
    4835d61 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2022

  1. Configuration menu
    Copy the full SHA
    1de2b51 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2022

  1. Fix BigQueryTableCheckOperator test

    Signed-off-by: Benji Lampel <benjamin@astronomer.io>
    denimalpaca committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    43a33c4 View commit details
    Browse the repository at this point in the history
  2. Remove job_id generation in table/col check operators

    The job_id is automatically generated by hook.insert_job()
    if an empty string is passed, so job_id generation in the
    operator is removed in favor of the existing code.
    
    Signed-off-by: Benji Lampel <benjamin@astronomer.io>
    denimalpaca committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    c761c05 View commit details
    Browse the repository at this point in the history
  3. Rework SQL query building

    SQL query building is moved to the init() method of the column
    and table check operators to lessen the amount of duplicate code
    in the child operator. It also has the added effect of, ideally,
    passing a more complete query to OpenLineage.
    
    In doing the above, the column check operator had to be reworked and
    now matches the logic of the table check operator in terms of
    returning multiple rows and only sending one query to the database.
    denimalpaca committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    d4758cb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cc87c3a View commit details
    Browse the repository at this point in the history
  5. Add option to fail check operators without retries

    Adds a new parameter, retry_on_failure, and a new function to
    determine if operators should retry or not on test failure.
    denimalpaca committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    c5d7422 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8080fc6 View commit details
    Browse the repository at this point in the history
  7. Update airflow/providers/common/sql/operators/sql.py

    Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
    denimalpaca and uranusjr committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    625d2b8 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4f3f400 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9400414 View commit details
    Browse the repository at this point in the history
  10. Update tests and operator code

    Updates tests to reflect changes in operator code, and fixed
    bugs in operators as well. Mainly moving the code to check for
    failed tests into the column and table check operators as it works
    slightly differently for each and doesn't make much sense as a
    top-level function.
    denimalpaca committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    0a794fb View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    efa1f79 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    213d0a2 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    12c7cef View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    1ff14c2 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    e36aaf5 View commit details
    Browse the repository at this point in the history
  16. Update operator logic and tests

    Adds "where" option in checks dictionaries for column and table
    operators, which may be renamed. This allows for check-level
    partitioning, whereas the partition_clause param will always be
    for all checks. New tests are added for this addition.
    denimalpaca committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    ac4fca4 View commit details
    Browse the repository at this point in the history
  17. Add testing for column check operator and line edits

    Cleans up operator and adds testing for new generator function.
    denimalpaca committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    8beb8ab View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    385317f View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    979def5 View commit details
    Browse the repository at this point in the history
  20. Edit operator docstring

    denimalpaca committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    586f6b4 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    c060da0 View commit details
    Browse the repository at this point in the history
  22. Updates from code review

    denimalpaca committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    8498cbf View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    a15e1a2 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    0f9bce3 View commit details
    Browse the repository at this point in the history
  25. Add new accept_none argument to column check operator

    The new argument, defaulting to true, will convert Nones returned
    from the query to 0s so numeric calculations can be performed
    correctly. This allows empty tables to be handled as a row of zeroes.
    
    Additional documentation is also supplied
    denimalpaca committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    3140a02 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    09c7b51 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    473f5ba View commit details
    Browse the repository at this point in the history
  28. Merge branch 'common_sql_bugfixes_and_improvements' of github.com:den…

    …imalpaca/airflow into common_sql_bugfixes_and_improvements
    denimalpaca committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    8299a55 View commit details
    Browse the repository at this point in the history