-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: add packages and content packages #313
Conversation
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
d4bba40
to
1641926
Compare
@mmarchetti - here is a basic implementation of the '/v1/content/.../packages' endpoint. |
1641926
to
bedfb7d
Compare
44e3bbc
to
9adc52d
Compare
@@ -269,6 +270,11 @@ def oauth(self) -> OAuth: | |||
""" | |||
return OAuth(self.resource_params, self.cfg.api_key) | |||
|
|||
@property | |||
@requires(version="2024.10.0-dev") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will bump this to 2024.11.0 after the release.
9adc52d
to
3eadab8
Compare
The __getattr__ method should always raise an AttributeError if the value does not exist instead of returning None. The existing implementation causes issues when converting to a Pandas DataFrame
3eadab8
to
2af9e39
Compare
I'll fix those linting errors. |
src/posit/connect/packages.py
Outdated
hash: NotRequired[Optional[str]] | ||
"""Package description hash for R packages.""" | ||
|
||
@overload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@overload |
src/posit/connect/packages.py
Outdated
|
||
@overload | ||
def find_by(self, **conditions): ... | ||
|
||
def find_by(self, **conditions): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for the overload and don't lose typing support when something is misspelled or a wrong type is given
@overload | |
def find_by(self, **conditions): ... | |
def find_by(self, **conditions): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing...
Method "fetch" overrides class "ActiveSequence" in an incompatible manner
Parameter "**conditions" has no corresponding parameterPylance[reportIncompatibleMethodOverride](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportIncompatibleMethodOverride)
I'm looking for a workaround, but no luck so far.
src/posit/connect/packages.py
Outdated
version: Required[str] | ||
"""The package version""" | ||
|
||
@overload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
@overload |
src/posit/connect/packages.py
Outdated
def fetch(self, **conditions: Unpack[_Fetch]): ... | ||
|
||
@overload | ||
def fetch(self, **conditions): ... | ||
|
||
def fetch(self, **conditions) -> Generator["Package"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def fetch(self, **conditions: Unpack[_Fetch]): ... | |
@overload | |
def fetch(self, **conditions): ... | |
def fetch(self, **conditions) -> Generator["Package"]: | |
def fetch(self, **conditions: Unpack[_Fetch]) -> Generator["Package"]: |
src/posit/connect/packages.py
Outdated
app_guid: NotRequired[str] | ||
"""The unique identifier of the application this package is associated with""" | ||
|
||
@overload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@overload |
src/posit/connect/packages.py
Outdated
|
||
@overload | ||
def find_by(self, **conditions) -> "Package | None": ... | ||
|
||
def find_by(self, **conditions) -> "Package | None": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
@overload | |
def find_by(self, **conditions) -> "Package | None": ... | |
def find_by(self, **conditions) -> "Package | None": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This review was half-done when the LLM hackathon kickoff started and now my pending comment is out of date and not displayed. Oops.
Adds packages support.
Resolves #304
Requires https://github.com/rstudio/connect/issues/28227