Skip to content

Commit b9c0770

Browse files
authored
Backport changes from development (#659)
* Backport changes from development * Delete travis file * Backport version checking * Backport pbutils fixes * Backport test write path * Backport test suite changes
1 parent 1c7efe5 commit b9c0770

File tree

12 files changed

+104
-101
lines changed

12 files changed

+104
-101
lines changed

.github/workflows/pr.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ jobs:
8585
- name: Lint Python code
8686
run: make flake8
8787

88+
- uses: actions/setup-go@v3
89+
with:
90+
go-version: "^1.19.13"
91+
8892
- name: Run Python tests
8993
run: make test-py
9094
env:

.github/workflows/push.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,9 @@ jobs:
8787
- name: Lint Python code
8888
run: make flake8
8989

90+
- uses: actions/setup-go@v3
91+
with:
92+
go-version: "^1.19.13"
93+
9094
- name: Run Python tests
9195
run: make test-py

.github/workflows/release.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ jobs:
8686
- name: Lint Python code
8787
run: make flake8
8888

89+
- uses: actions/setup-go@v3
90+
with:
91+
go-version: "^1.19.13"
92+
8993
- name: Run Python tests
9094
run: make test-py
9195

@@ -115,7 +119,7 @@ jobs:
115119

116120
- uses: actions/setup-go@v3
117121
with:
118-
go-version: "^1.19.5"
122+
go-version: "^1.19.13"
119123

120124
- name: Build binaries for ${{ matrix.go-os }}
121125
run: make frames-bin
@@ -187,7 +191,7 @@ jobs:
187191
- name: Set up python ${{ matrix.python-version }}
188192
uses: actions/setup-python@v4
189193
with:
190-
python-version: 3.7
194+
python-version: 3.9
191195

192196
- name: Set version
193197
run: make set-version

README.md

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
55

66
V3IO Frames (**"Frames"**) is a multi-model open-source data-access library that provides a unified high-performance DataFrame API for working with different types of data sources (backends).
7-
The library was developed by Iguazio to simplify working with data in the [Iguazio Data Science Platform](https://www.iguazio.com) (**"the platform"**), but it can be extended to support additional backend types.
8-
9-
> **Note:** For a full API reference of the Frames platform backends, including detailed examples, see the Frames API reference in [the platform documentation](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/).
7+
The library was developed by Iguazio to simplify working with data in the [Iguazio MLOps Platform](https://www.iguazio.com) (**"the platform"**), but it can be extended to support additional backend types.
108

119
#### In This Document
1210

@@ -39,7 +37,7 @@ The library was developed by Iguazio to simplify working with data in the [Iguaz
3937
<a id="python-version"></a>
4038
#### Python Version
4139

42-
The current version of Frames supports Python 3.6 and 3.7.
40+
The current version of Frames supports Python 3.7 and 3.9.
4341

4442
<a id="initialization"></a>
4543
#### Initialization
@@ -59,15 +57,12 @@ All Frames client methods receive a [`backend`](#client-method-param-backend) pa
5957
Frames currently supports the following backend types:
6058

6159
- `nosql` | `kv` &mdash; a platform NoSQL (key/value) table.
62-
See the [platform NoSQL backend API reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/nosql/).
6360
<br/><br/>
6461
> **Note:** The documentation uses the `"nosql"` alias to the `"kv"` type, which was added in Frames v0.6.10-v0.9.13; `"kv"` is still supported for backwards compatibility with earlier releases.
6562
- `stream` &mdash; a platform data stream **[Tech Preview]**.
6663
<!-- [FRAMES-STREAMING-NO-SUPPORT]
67-
See the [platform streaming backend API reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/stream/).
6864
-->
6965
- `tsdb` &mdash; a time-series database (TSDB).
70-
See the [platform TSDB backend API reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/tsdb/).
7166
- `csv` &mdash; a comma-separated-value (CSV) file.
7267
This backend type is used only for testing purposes.
7368

@@ -91,7 +86,6 @@ The `Client` class features the following methods for supporting operations on a
9186

9287
When creating a Frames client, you must provide valid credentials for accessing the backend data, which Frames will use to identify the identity of the user.
9388
This can be done by using any of the following alternative methods (documented in order of precedence).
94-
For more information about the user authentication for the platform backends, see the [platform documentation](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/overview/#user-authentication):
9589

9690
- <a id="user-auth-client-const-params"></a>Provide the authentication credentials in the call to the [`Client` constructor](#client-constructor) &mdash; either by setting the [`token`](#client-param-token) parameter to a valid authentication token (access key) or by setting the [`user`](#client-param-user) and [`password`](#client-param-password) parameters to a username and password.
9791
Note that you cannot set the token parameter concurrently with the username and password parameters.
@@ -124,7 +118,7 @@ Client(address=""[, data_url=""], container=""[, user="", password="", token=""]
124118

125119
- <a id="client-param-address"></a>**address** &mdash; The address of the Frames service (`framesd`).
126120
Use the `grpc://` prefix for gRPC (default; recommended) or the `http://` prefix for HTTP.
127-
When running locally on the platform, set this parameter to `framesd:8081` to use the gRPC (recommended) or to `framesd:8080` to use HTTP; for more information, see the [platform documentation](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/client-constructor/).
121+
When running locally on the platform, set this parameter to `framesd:8081` to use the gRPC (recommended) or to `framesd:8080` to use HTTP.
128122

129123
- **Type:** `str`
130124
- **Requirement:** Required
@@ -252,7 +246,7 @@ All Frames backends that support the `create` method support the following commo
252246
<a id="method-create-params-tsdb"></a>
253247
#### `tsdb` Backend `create` Parameters
254248

255-
The following `create` parameters are specific to the `tsdb` backend and are passed as keyword arguments via the `kw` parameter; for more information and examples, see the platform's [Frames TSDB-backend reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/tsdb/create/):
249+
The following `create` parameters are specific to the `tsdb` backend and are passed as keyword arguments via the `kw` parameter:
256250

257251
- <a id="method-create-tsdb-param-rate"></a>**rate** &mdash; metric-samples ingestion rate.
258252

@@ -279,8 +273,7 @@ The following `create` parameters are specific to the `tsdb` backend and are pas
279273
<a id="method-create-params-stream"></a>
280274
#### `stream` Backend `create` Parameters
281275

282-
The following `create` parameters are specific to the `stream` backend and are passed as keyword arguments via the `kw` parameter<!--; for more information and examples, see the platform's [Frames streaming-backend reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/stream/create/)-->:
283-
<!-- [FRAMES-STREAMING-NO-SUPPORT] -->
276+
The following `create` parameters are specific to the `stream` backend and are passed as keyword arguments via the `kw` parameter:
284277

285278
- <a id="method-create-stream-param-shards"></a>**shards** &mdash; The number of stream shards to create.
286279

@@ -385,7 +378,7 @@ All Frames backends that support the `write` method support the following common
385378
<a id="method-write-params-nosql"></a>
386379
#### `nosql` Backend `write` Parameters
387380

388-
The following `write` parameters are specific to the `nosql` backend; for more information and examples, see the platform's [Frames NoSQL-backend reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/nosql/write/):
381+
The following `write` parameters are specific to the `nosql` backend:
389382

390383
<!--
391384
- <a id="method-write-nosql-param-expression"></a>**expression** (Optional) (default: `None`) &mdash; A platform update expression that determines how to update the table for all items in the DataFrame.
@@ -420,7 +413,7 @@ client.write(backend="nosql", table="mytable", dfs=df, expression="city='NY'", c
420413
<a id="method-write-params-tsdb"></a>
421414
#### `tsdb` Backend `write` Parameters
422415

423-
The following `write` parameter descriptions are specific to the `tsdb` backend; for more information and examples, see the platform's [Frames TSDB-backend reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/tsdb/write/):
416+
The following `write` parameter descriptions are specific to the `tsdb` backend:
424417

425418
- <a id="method-write-tsdb-param-labels"></a>**labels** &mdash; A dictionary of metric labels of the format `{<label>: <value>[, <label>: <value>, ...]}` to apply to all the DataFrame rows.
426419
For example, `{"os": "linux", "arch": "x86"}`.
@@ -522,7 +515,7 @@ All Frames backends that support the `read` method support the following common
522515
<a id="method-read-params-nosql"></a>
523516
#### `nosql` Backend `read` Parameters
524517

525-
The following `read` parameters are specific to the `nosql` backend; for more information and examples, see the platform's [Frames NoSQL-backend reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/nosql/read/):
518+
The following `read` parameters are specific to the `nosql` backend:
526519

527520
- <a id="method-read-nosql-param-max_rows_in_msg"></a>**max_rows_in_msg** &mdash; The maximum number of rows per message.
528521

@@ -547,7 +540,7 @@ The following parameters are passed as keyword arguments via the `kw` parameter:
547540
<a id="method-read-params-tsdb"></a>
548541
#### `tsdb` Backend `read` Parameters
549542

550-
The following `read` parameters are specific to the `tsdb` backend; for more information and examples, see the platform's [Frames TSDB-backend reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/tsdb/read/):
543+
The following `read` parameters are specific to the `tsdb` backend:
551544

552545
- <a id="method-read-tsdb-param-group_by"></a>**group_by** **[Tech Preview]** &mdash; A group-by query string.
553546
<br/>
@@ -615,8 +608,7 @@ The following parameters are passed as keyword arguments via the `kw` parameter:
615608
<a id="method-read-params-stream"></a>
616609
#### `stream` Backend `read` Parameters
617610

618-
The following `read` parameters are specific to the `stream` backend and are passed as keyword arguments via the `kw` parameter<!--; for more information and examples, see the platform's [Frames streaming-backend reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/stream/read/)-->:
619-
<!-- [FRAMES-STREAMING-NO-SUPPORT] -->
611+
The following `read` parameters are specific to the `stream` backend and are passed as keyword arguments via the `kw` parameter:
620612

621613
- <a id="method-read-stream-param-seek"></a>**seek** &mdash; Seek type.
622614
<br/>
@@ -722,7 +714,7 @@ delete(backend, table, filter='', start='', end='', if_missing=FAIL
722714
<a id="method-delete-params-nosql"></a>
723715
#### `nosql` Backend `delete` Parameters
724716

725-
The following `delete` parameters are specific to the `nosql` backend; for more information and examples, see the platform's [Frames NoSQL-backend reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/nosql/delete/):
717+
The following `delete` parameters are specific to the `nosql` backend:
726718

727719
- <a id="method-delete-nosql-param-filter"></a>**filter** &mdash; A filter expression that identifies specific items to delete.
728720

@@ -733,7 +725,7 @@ The following `delete` parameters are specific to the `nosql` backend; for more
733725
<a id="method-delete-params-tsdb"></a>
734726
#### `tsdb` Backend `delete` Parameters
735727

736-
The following `delete` parameters are specific to the `tsdb` backend; for more information and examples, see the platform's [Frames TSDB-backend reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/tsdb/delete/):
728+
The following `delete` parameters are specific to the `tsdb` backend:
737729

738730
- <a id="method-delete-tsdb-param-start"></a>**start** &mdash; Start (minimum) time for the delete operation &mdash; i.e., delete only items whose data sample time is at or after (`>=`) the specified start time.
739731

@@ -822,7 +814,7 @@ All Frames backends that support the `execute` method support the following comm
822814
<a id="method-execute-nosql-cmds"></a>
823815
#### `nosql` Backend `execute` Commands
824816

825-
The following `execute` commands are specific to the `nosql` backend; for more information and examples, see the platform's [Frames NoSQL-backend reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/nosql/execute/):
817+
The following `execute` commands are specific to the `nosql` backend:
826818

827819
- <a id="method-execute-nosql-cmd-infer"></a>**infer | infer_schema** &mdash; Infers the data schema of a given NoSQL table and creates a schema file for the table.
828820

@@ -845,8 +837,7 @@ The following `execute` commands are specific to the `nosql` backend; for more i
845837
<a id="method-execute-stream-cmds"></a>
846838
#### `stream` Backend `execute` Commands
847839

848-
The following `execute` commands are specific to the `stream` backend<!--; for more information and examples, see the platform's [Frames streaming-backend reference](https://www.iguazio.com/docs/latest-release/data-layer/reference/frames/stream/execute/)-->:
849-
<!-- [FRAMES-STREAMING-NO-SUPPORT] -->
840+
The following `execute` commands are specific to the `stream` backend:
850841

851842
- <a id="method-execute-stream-cmd-put"></a>**put** &mdash; Adds records to a stream shard.
852843

clients/py/.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

clients/py/v3io_frames/grpc.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,15 @@ def _check_version(self):
245245
stub = fgrpc.FramesStub(self._channel)
246246
request = fpb.VersionRequest()
247247
resp = stub.Version(request)
248+
server_version = resp.version
249+
if server_version.startswith("v"):
250+
server_version = server_version[1:]
248251
if resp.version:
249-
client_version = __version__[:__version__.rfind(".")]
250-
server_version = resp.version[:resp.version.rfind(".")]
251-
if client_version != server_version:
252+
client_major_minor_version = __version__[:__version__.rfind(".")]
253+
server_major_minor__version = server_version[:server_version.rfind(".")]
254+
if client_major_minor_version != server_major_minor__version:
252255
warnings.warn(
253-
f"Warning - Server version '{resp.version}' differs in major/minor version from client "
256+
f"Warning - Server version '{server_version}' differs in major/minor version from client "
254257
f"version '{__version__}'. Some operations may not work as expected."
255258
)
256259
else:

clients/py/v3io_frames/http.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,20 @@ def _check_version(self):
247247
except json.JSONDecodeError as err:
248248
raise VersionError(str(err))
249249

250-
version = out.get('version')
251-
if not version:
250+
server_version = out.get('version')
251+
if server_version.startswith("v"):
252+
server_version = server_version[1:]
253+
if not server_version:
252254
warnings.warn("Warning - Cannot resolve server version. Make sure client version is compatible.")
253255
return
254256

255-
if __version__ != version:
256-
warnings.warn("Warning - Server version \'" + version + "\' is different from client version \'" + __version__ + "\'. Some operations may not work as expected.")
257+
client_major_minor_version = __version__[:__version__.rfind(".")]
258+
server_major_minor__version = server_version[:server_version.rfind(".")]
259+
if client_major_minor_version != server_major_minor__version:
260+
warnings.warn(
261+
f"Warning - Server version '{server_version}' differs in major/minor version from client "
262+
f"version '{__version__}'. Some operations may not work as expected."
263+
)
257264

258265
def _url_for(self, action):
259266
return self.address + '/' + action

test/csv_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (csvSuite *CsvTestSuite) TestAll() {
9898
err = appender.Add(frame)
9999
csvSuite.Require().NoError(err)
100100

101-
err = appender.WaitForComplete(3 * time.Second)
101+
err = appender.WaitForComplete(10 * time.Second)
102102
csvSuite.Require().NoError(err)
103103

104104
time.Sleep(3 * time.Second) // Let DB sync

0 commit comments

Comments
 (0)