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

History in context #26

Merged
merged 7 commits into from Jan 16, 2018
Merged

History in context #26

merged 7 commits into from Jan 16, 2018

Conversation

danpalmer
Copy link
Contributor

I recommend reviewing per-commit here, it should be much simpler.

metadata: Dict[str, Any] = {},
now: datetime.datetime = None,
feeds: Dict[str, Feed] = {},
accessed_variables: Iterable[str] = [],
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure that having these mutable defaults is a good idea (maybe add flake8-mutable?).

Perhaps a better way to solve this would be a helper used in tests which handles the non-interesting defaults?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've fixed these with a test factory method that has the defaults (but not as mutable args).

@@ -19,6 +19,7 @@ def __init__(
now: datetime.datetime = None,
feeds: Dict[str, Feed] = {},
accessed_variables: Iterable[str] = [],
current_history_entry: Optional[Any] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really not have a type for the entry? Or is it that SqlAlchemy doesn't provide a useful type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The latter, because we aren't using the ORM. This will change eventually I hope.

@danpalmer danpalmer merged commit aa13991 into master Jan 16, 2018
@danpalmer danpalmer deleted the history-in-context branch January 16, 2018 11:48
@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 99.153% when pulling a702980 on history-in-context into d8e449b on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants