Skip to content

Fix import error for backup dags without xcom or task instance #41

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

holly-evans
Copy link
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Dependency Update
  • Release

Description

Custom DAG factories cannot create backup dags unless they include the xcom and task_instance tables.

This PR fixes create_backup_dag to catch the KeyError if either xcom or task_instance is not one of the export_tasks.

Related Tickets & Documents

Linting

Have you done linting by issuing ./build.sh lint command?

  • Yes
  • No, I need help with linting

Testing

Have you run testing by issuing ./build.sh unit command?

  • Yes
  • No, I need help with writing tests

Documentation

Have you updated the README appropriate for this PR?

  • Yes
  • No, README does not need any changes for this PR

Changelog

Have you updated the CHANGELOG with the changes you are making in this PR?
Please use Added, Removed, and/or Changed subsections under the Unreleased section.

  • Yes
  • No, I need help

Terms of Contribution

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@crupakheti crupakheti self-assigned this Feb 17, 2025
@crupakheti crupakheti self-requested a review February 17, 2025 17:16
@crupakheti
Copy link
Contributor

@holly-evans Thank you for your contribution! We will get started with the review soon.

Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  assets/dags/mwaa_dr/framework/factory
  base_dr_factory.py 348-349
Project Total  

This report was generated by python-coverage-comment-action

@crupakheti crupakheti added the bug Something isn't working label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] create_backup_dag produces IndexError if xcom and task_instance are not included in tables
2 participants