posit-dev / posit-dev/rsconnect-python

`RSConnectExecutor.server_settings` throws error if `self.client` is a `PositClient` object

Open
#547 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
37
Forks
28
Avg merge
1d 3h
Merged PRs (30d)
7

Description

With a RSConnectExecutor object, if .server_settings is accessed and self.client is a PositClient object (as opposed to a RSConnectClient object), it will throw an error.

I'm running into this problem while working on #545, when I try to deploy a Shiny app to shinyapps.io.

The problem is that the server_settings property accesses self.client.server_settings. self.client can be a RSConnectClient or PositClient object. However, the PositClient class does not have .server_settings.

https://github.com/rstudio/rsconnect-python/blob/34c77ea280c353ebdc8f2987f31765736aa6f96f/rsconnect/api.py#L916-L919

Maybe the PositClient class could have a .server_settings field, set to None or an empty dictionary?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in rsconnect/api.py at the server_settings property around lines 916–919, then inspect how RSConnectExecutor uses self.client and compare the RSConnectClient and PositClient classes. The fix is done when accessing server_settings with either client type no longer raises an attribute error and existing RSConnectClient behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.