Skip to content

Commit 94973c5

Browse files
authored
Merge pull request #173 from rstudio/feat-board-connect
feat: add board_connect for Posit Connect, formerly RStudio
2 parents 1879aa9 + 3f6b08a commit 94973c5

File tree

8 files changed

+23
-17
lines changed

8 files changed

+23
-17
lines changed

docs/api/constructors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ Board Constructors
1212
~board_s3
1313
~board_gcs
1414
~board_azure
15-
~board_rsconnect
15+
~board_connect
1616
~board_url
1717
~board

docs/api/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ Boards abstract over different storage backends, making it easy to share data in
3636
- Use an Azure storage container as a board
3737
* - :func:`.board_folder`, :func:`.board_local`, :func:`.board_temp`
3838
- Use a local folder as a board
39+
* - :func:`.board_connect`
40+
- Use Posit Connect as a board
3941
* - :func:`.board_rsconnect`
40-
- Use RStudio Connect as a board
42+
- Alias for Posit Connect board (it was formerly called RStudio Connect)
4143
* - :func:`.board_s3`
4244
- Use an S3 bucket as a board
4345
* - :func:`.board_gcs`

docs/getting_started.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Here are a few options:
4646
board = board_local() # share data across R sessions on the same computer
4747
board = board_folder("~/Dropbox") # share data with others using dropbox
4848
board = board_folder("Z:\\my-team\pins") # share data using a shared network drive
49-
board = board_rsconnect() # share data with RStudio Connect
49+
board = board_connect() # share data with Posit Connect
5050
```
5151

5252

@@ -88,7 +88,7 @@ If you find yourself routinely pinning data larger that this, you might need to
8888

8989
<!-- #region -->
9090
```{note}
91-
If you are using the RStudio Connect board (`board_rsconnect`), then you must specify your pin name as
91+
If you are using the Posit Connect board (`board_connect`), then you must specify your pin name as
9292
`<user_name>/<content_name>`. For example, `hadley/sales-report`.
9393
```
9494
<!-- #endregion -->

docs/intro.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ kernelspec:
2121
```
2222

2323
The pins package publishes data, models, and other Python objects, making it easy to share
24-
You can pin objects to a variety of pin *boards*, including folders (to share on a networked drive or with services like DropBox), RStudio Connect, Amazon S3, Google Cloud Storage, and Azure Datalake.
24+
You can pin objects to a variety of pin *boards*, including folders (to share on a networked drive or with services like DropBox), Posit Connect, Amazon S3, Google Cloud Storage, and Azure Datalake.
2525
Pins can be automatically versioned, making it straightforward to track changes, re-run analyses on historical data, and undo mistakes.
2626

2727
You can use pins from R as well as Python. For example, you can use one language to read a pin created with the other. Learn more about [pins for R](https://pins.rstudio.com).
@@ -67,14 +67,14 @@ board.pin_read("mtcars")
6767
```
6868

6969
A board on your computer is good place to start, but the real power of pins comes when you use a board that's shared with multiple people.
70-
To get started, you can use `board_folder()` with a directory on a shared drive or in DropBox, or if you use [RStudio Connect](https://www.rstudio.com/products/connect/) you can use `board_rsconnect()`:
70+
To get started, you can use `board_folder()` with a directory on a shared drive or in DropBox, or if you use [Posit Connect](https://www.posit.co/products/connect/) you can use `board_connect()`:
7171

7272
+++
7373

7474
```python
75-
from pins import board_rsconnect
75+
from pins import board_connect
7676

77-
board = board_rsconnect()
77+
board = board_connect()
7878

7979
board.pin_write(tidy_sales_data, "hadley/sales-summary", type = "csv")
8080
#> Writing pin:
@@ -89,13 +89,13 @@ Then, someone else (or an automated report) can read and use your pin:
8989
+++
9090

9191
```python
92-
board = board_rsconnect()
92+
board = board_connect()
9393
board.pin_read("hadley/sales-summary")
9494
```
9595

9696
+++
9797

98-
You can easily control who gets to access the data using the RStudio Connect permissions pane.
98+
You can easily control who gets to access the data using the Posit Connect permissions pane.
9999

100100
The pins package also includes boards that allow you to share data on services like
101101
Amazon's S3 (`board_s3()`), Google Cloud Storage (`board_gcs()`), and Azure Datalake (`board_azure()`).

pins/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
board_github,
1919
board_urls, # DEPRECATED
2020
board_url,
21+
board_connect,
2122
board_rsconnect,
2223
board_azure,
2324
board_s3,

pins/constructors.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def board_deparse(board: BaseBoard):
3131
3232
The example below deparses a board connected to RStudio Connect.
3333
34-
>>> board_deparse(board_rsconnect(server_url="http://example.com", api_key="xxx"))
35-
"board_rsconnect(server_url='http://example.com')"
34+
>>> board_deparse(board_connect(server_url="http://example.com", api_key="xxx"))
35+
"board_connect(server_url='http://example.com')"
3636
3737
Note that the deparsing an RStudio Connect board does not keep the api_key,
3838
which is sensitive information. In this case, you can set the CONNECT_API_KEY
@@ -55,7 +55,7 @@ def board_deparse(board: BaseBoard):
5555

5656
if prot == "rsc":
5757
url = board.fs.api.server_url
58-
return f"board_rsconnect(server_url={repr(url)}{allow_pickle})"
58+
return f"board_connect(server_url={repr(url)}{allow_pickle})"
5959
elif prot == "file":
6060
return f"board_folder({repr(board.board)}{allow_pickle})"
6161
elif prot == ["s3", "s3a"]:
@@ -353,7 +353,7 @@ def board_url(path: str, pin_paths: dict, cache=DEFAULT, allow_pickle_read=None)
353353
)
354354

355355

356-
def board_rsconnect(
356+
def board_connect(
357357
server_url=None, versioned=True, api_key=None, cache=DEFAULT, allow_pickle_read=None
358358
):
359359
"""Create a board to read and write pins from an RStudio Connect instance.
@@ -375,7 +375,7 @@ def board_rsconnect(
375375
::
376376
377377
server_url = "https://connect.rstudioservices.com"
378-
board = board_rsconnect(server_url)
378+
board = board_connect(server_url)
379379
380380
In order to read a public pin, use board_manual with the public pin url.
381381
@@ -406,6 +406,9 @@ def board_rsconnect(
406406
)
407407

408408

409+
board_rsconnect = board_connect
410+
411+
409412
def board_s3(path, versioned=True, cache=DEFAULT, allow_pickle_read=None):
410413
"""Create a board to read and write pins from an AWS S3 bucket folder.
411414

pins/tests/_snapshots/test_board_pin_write_rsc_index_html/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ <h3>derek/test_rsc_pin</h3>
5959
<h3>Python Code</h3>
6060

6161
<pre id="pin-python" class="pin-code"><code class="python">from pins import board_rsconnect
62-
board = board_rsconnect(server_url='http://localhost:3939')
62+
board = board_connect(server_url='http://localhost:3939')
6363
board.pin_read("derek/test_rsc_pin")</code></pre>
6464

6565
<script type="text/javascript">

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test =
5555
pytest-dotenv
5656
pytest-parallel
5757
s3fs
58-
adlfs
58+
adlfs==2022.2.0
5959
gcsfs
6060
fastparquet
6161
pyarrow

0 commit comments

Comments
 (0)