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

fix: Source freshness errors with optional filter arg #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eliyarson
Copy link

Description

When using optional freshness argument filter the hook check_source_has_freshness.py returns the following error:

AttributeError: 'str' object has no attribute 'keys'

It happens because the hook is expecting dictionaries (warn_after and error_after), but filter is a string.
A simple fix is to pop the key if it exists before checking for required keys as I did in the PR.

Obs: I had to change github flake8 pre-commit hook from gitlab to github because I don't have a gitlab acc, feel free to change back to gitlab if you guys think it's necessary.

Testing

pytest tests/unit/test_check_source_has_freshness.py

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.

1 participant