blaze / blaze/blaze

Update blazer-server documentation and understand `data()` interface in order to do so

Open
#1,535 0 comments 0 reactions 1 assignee Claimed by @sandhujasmine View on GitHub
documentation
Dominant language
Python
Stars
3.2k
Forks
389
PR merge metrics
No merged PRs in 30d

Description

Picking up the second heading from: #1507

Looking at the second heading in #1507

> ### Example with Blaze Server
> - Serve up datasets--CSV, PostgreSQL DB--on server machine
> - Connect to it via `blaze.data("blaze://...")` URI.
> - Demonstrate interactivity and ability to do basic computations.

[Existing documentation](https://github.com/blaze/blaze/blob/master/docs/source/server.rst#setting-up-a-blaze-server) for setting up the blaze server is valid.

I believe the [second section](https://github.com/blaze/blaze/blob/master/docs/source/server.rst#serving-data-from-the-command-line) needs updating. Specifically:
- [ ] update the YAML file to use full path so tutorial works with blaze installed. Tutorial can include how `blaze.utils.example` function to get the full path to each dataset, then construct the YAML file.
- [ ] Need to understand how the `data` interface should be used in this example. In this

Say we define a blaze server_conf.yaml file that points to the various example datasets:

server_conf.yaml:

```
iriscsv:
source: {full_path_to_data}/iris.csv
irisdb:
source: sqlite:///{full_path_to_data}/iris.db
accounts:
source: {full_path_to_data}/accounts.json.gz
dshape: "var * {name: string, amount: float64}"
```

Full path to data can be obtained by:

```
In [1]: from blaze.utils import example
In [2]: full_path_to_data = example('iris.csv')
In [3]: full_path_to_data = example('iris.db')
In [4]: full_path_to_data = example('iris.accounts.json.gz')
```

Run `blaze-server server_conf.yaml` - server is running on: `http://127.0.0.1:6363/`. Now fire up ipython and try to load each dataset. I can query the

```
# to access the underlying data, we can do the following
data('blaze://127.0.0.1:6363')['accounts']
data('blaze://127.0.0.1:6363')['iriscsv']
data('blaze://127.0.0.1:6363')['irisdb'].iris
```

Issues:
- The iris data is not being accessed the same way for all three resources - this is confusing.
- From #1357, it seems the `data()` and `symbol()` objects are similar `data()` is bound to a backend resource while `symbol()` is unbound. I don't fully understand the many ways in which `data()` can be used.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.