Skip to content

Commit

Permalink
Merge pull request #97 from Alexander-D-Lewis/feature/update-sdk-schema
Browse files Browse the repository at this point in the history
update sdk schema with description, is_latest_version and update_beha…
  • Loading branch information
lcardno10 authored Sep 26, 2024
2 parents c01f5a9 + 23514fa commit 90a0057
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/changelog/sdk.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# SDK Changelog

## v0.1.9 - _2024-09-12_

### Features

- Expanded rAPId sdk metadata to include: update_behaviour, is_latest_version and description.

## v0.1.8 - _2024-03-21_

### Features
Expand Down
3 changes: 3 additions & 0 deletions sdk/rapid/items/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class SchemaMetadata(BaseModel):
version: Optional[int] = None
key_value_tags: Optional[Dict[str, str]] = {}
key_only_tags: Optional[List[str]] = []
description: Optional[str] = ""
update_behaviour: Optional[str] = "APPEND"
is_latest_version: Optional[bool] = True

class Config:
use_enum_values = True
Expand Down
2 changes: 1 addition & 1 deletion sdk/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os

TEST_SDK_VERSION = os.getenv("TEST_SDK_VERSION")
version = "0.1.8"
version = "0.1.9"
setup(
name="rapid-sdk",
version=version if TEST_SDK_VERSION is None else f"{version}.{TEST_SDK_VERSION}",
Expand Down
12 changes: 12 additions & 0 deletions sdk/tests/test_items/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
dataset="rapid_sdk",
sensitivity=SensitivityLevel.PUBLIC,
owners=[Owner(name="Test", email="[email protected]")],
description="test",
update_behaviour="OVERWRITE",
is_latest_version=True,
)


Expand All @@ -62,13 +65,19 @@ def test_create_schema_metadata_from_dict(self):
"dataset": "rapid_sdk",
"sensitivity": SensitivityLevel.PUBLIC,
"owners": [{"name": "Test", "email": "[email protected]"}],
"description": "test",
"update_behaviour": "OVERWRITE",
"is_latest_version": True,
}

schema_metadata = SchemaMetadata(**_schema_metadata)
assert schema_metadata.domain == "test"
assert schema_metadata.dataset == "rapid_sdk"
assert schema_metadata.sensitivity == "PUBLIC"
assert schema_metadata.owners == [Owner(name="Test", email="[email protected]")]
assert schema_metadata.description == "test"
assert schema_metadata.update_behaviour == "OVERWRITE"
assert schema_metadata.is_latest_version == True


class TestColumn:
Expand Down Expand Up @@ -265,6 +274,9 @@ def test_schema_returns_correct_dictionary(self):
"version": None,
"key_value_tags": {},
"key_only_tags": [],
"description": "test",
"update_behaviour": "OVERWRITE",
"is_latest_version": True,
},
"columns": [
{
Expand Down

0 comments on commit 90a0057

Please sign in to comment.