Skip to content

Feat: Add ability to set the effective date for forward-only snapshots#785

Merged
izeigerman merged 3 commits intomainfrom
add-snapshot-effective-from
Apr 28, 2023
Merged

Feat: Add ability to set the effective date for forward-only snapshots#785
izeigerman merged 3 commits intomainfrom
add-snapshot-effective-from

Conversation

@izeigerman
Copy link
Contributor

No description provided.

@izeigerman izeigerman requested review from a team, eakmanrq and tobymao April 28, 2023 20:29
return self._effective_from

@effective_from.setter
def effective_from(self, effective_from: t.Optional[TimeLike]) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

why have this and both _set_effective_from? why not just have the setter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So that it doesn't look confusing when we set in the constructor.

Copy link
Contributor

Choose a reason for hiding this comment

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

i don't think it will be confusing?

if effective_from:
self.effective_from = effective_from is fine right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It'd be more like:

self._effective_from = None
if effective_from:
    self.effective_from = effective_from is fine right?

So it looks like we're setting it twice, which is a confusing part.

Copy link
Contributor

Choose a reason for hiding this comment

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

you don't need to initialize the first one

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 do, because plan.effective_from will return an attribute error if I never set it.

@izeigerman izeigerman merged commit 48ebc1e into main Apr 28, 2023
@izeigerman izeigerman deleted the add-snapshot-effective-from branch April 28, 2023 23:18
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.

3 participants