Skip to content

move validate from classmethod to instance method#147

Merged
ircwaves merged 2 commits into
stac-utils:mainfrom
ircwaves:irc/133-move-validate-to-instance-method
Sep 16, 2024
Merged

move validate from classmethod to instance method#147
ircwaves merged 2 commits into
stac-utils:mainfrom
ircwaves:irc/133-move-validate-to-instance-method

Conversation

@ircwaves

@ircwaves ircwaves commented Sep 12, 2024

Copy link
Copy Markdown
Member

Related Issue(s):

Proposed Changes:

  1. push self._payload assignment up,
  2. move self.validate(payload) -> self.validate(), with the latter inspecting the self._payload member.

PR Checklist:

  • I have added my changes to the CHANGELOG or a CHANGELOG entry is not required.

@ircwaves ircwaves force-pushed the irc/133-move-validate-to-instance-method branch from 3ae24dd to e2cebf6 Compare September 12, 2024 15:48
@ircwaves

Copy link
Copy Markdown
Member Author

@philvarner and or @gadomski -- think this is warrants a ⚠️ Breaking Change in the log?

@ircwaves ircwaves marked this pull request as ready for review September 12, 2024 18:47
@pjhartzell

pjhartzell commented Sep 13, 2024

Copy link
Copy Markdown
Collaborator

@philvarner and or @gadomski -- think this is warrants a ⚠️ Breaking Change in the log?

I think so. It breaks existing packages that rely on stac-task.

@gadomski

Copy link
Copy Markdown
Member

Yup, 👍🏼 to marking as breaking.

@ircwaves ircwaves force-pushed the irc/133-move-validate-to-instance-method branch from e2cebf6 to 8128b8f Compare September 16, 2024 14:06
@gadomski gadomski linked an issue Sep 16, 2024 that may be closed by this pull request

@gadomski gadomski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, and I linked this to the referenced issue to close.

@pjhartzell pjhartzell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved, subject to one fixup and comment.

Comment is that I have some uneasiness around why this was a classmethod to begin with. Are we missing an intended purpose? Perhaps a use more along the lines of a staticmethod where you could fling payloads at the class for validation? That said, I think the change is logical, and we can modify based on user feedback.

Comment thread CHANGELOG.md Outdated
Co-authored-by: Preston Hartzell <preston.hartzell@gmail.com>
@ircwaves ircwaves enabled auto-merge (squash) September 16, 2024 18:00
@ircwaves ircwaves merged commit 6198c8b into stac-utils:main Sep 16, 2024
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.

Change validate to instance method

3 participants