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

adding skip exit code for lightbeam #12

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

tomreitz
Copy link
Collaborator

If lightbeam skips sending all payloads because state tracking is enabled and no payloads have changed, we now exit with code 99 to signal Airflow (or other apps) to skip downstream tasks.

… state tracking is enabled and no payloads have changed
with open(self.lightbeam.results_file, 'w') as fp:
fp.write(json.dumps(self.metadata, indent=4))

if self.metadata["total_records_processed"] == self.metadata["total_records_skipped"]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this will work, assuming that rows are added to both lists at the same time (and hence are in the same order).

@tomreitz tomreitz merged commit 8dcf182 into main Jun 13, 2023
@tomreitz tomreitz deleted the feature/nonzero_exit_code_for_airflow_skip branch June 13, 2023 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants