Skip to content

Commit

Permalink
chore: add pydantic plugin for mypy (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
mure committed Apr 9, 2024
1 parent 0532466 commit a842173
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
6 changes: 3 additions & 3 deletions examples/dataframe/create_write_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
CreateTableRequest(
name="Example Table",
columns=[
Column(name="index", dataType=DataType.Int32, columnType=ColumnType.Index),
Column(name="Float_Column", dataType=DataType.Float32),
Column(name="Timestamp_Column", dataType=DataType.Timestamp),
Column(name="ix", data_type=DataType.Int32, column_type=ColumnType.Index),
Column(name="Float_Column", data_type=DataType.Float32),
Column(name="Timestamp_Column", data_type=DataType.Timestamp),
],
)
)
Expand Down
2 changes: 1 addition & 1 deletion examples/spec/query_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
# You can query specs based on any field using DynamicLinq syntax.
# These are just some representative examples.

response = client.query_specs(QuerySpecificationsRequest(productIds=[product]))
response = client.query_specs(QuerySpecificationsRequest(product_ids=[product]))
all_product_specs = response.specs

# Query based on spec id
Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
mypy_path=nisystemlink/stubs
files=nisystemlink,tests
warn_unused_configs=True
plugins = pydantic.mypy

[mypy-nisystemlink.*]
disallow_untyped_calls=True
Expand Down
22 changes: 11 additions & 11 deletions tests/integration/spec/test_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def test__create_single_spec__one_created_with_right_field_values(
specId = uuid.uuid1().hex
productId = product
spec = SpecificationDefinition(
productId=productId,
specId=specId,
product_id=productId,
spec_id=specId,
type=SpecificationType.FUNCTIONAL,
keywords=["work", "reviewed"],
category="Parametric Specs",
Expand All @@ -141,8 +141,8 @@ def test__create_multiple_specs__all_succeed(
specs = []
for id in specIds:
spec = SpecificationDefinition(
productId=productId,
specId=id,
product_id=productId,
spec_id=id,
type=SpecificationType.FUNCTIONAL,
keywords=["work", "reviewed"],
category="Parametric Specs",
Expand All @@ -159,8 +159,8 @@ def test__create_duplicate_spec__errors(
duplicate_id = uuid.uuid1().hex
productId = product
spec = SpecificationDefinition(
productId=productId,
specId=duplicate_id,
product_id=productId,
spec_id=duplicate_id,
type=SpecificationType.FUNCTIONAL,
keywords=["work", "reviewed"],
category="Parametric Specs",
Expand All @@ -180,8 +180,8 @@ def test__delete_existing_spec__succeeds(self, client: SpecClient, product):
specId = uuid.uuid1().hex
productId = product
spec = SpecificationDefinition(
productId=productId,
specId=specId,
product_id=productId,
spec_id=specId,
type=SpecificationType.FUNCTIONAL,
)
response = client.create_specs(CreateSpecificationsRequest(specs=[spec]))
Expand All @@ -202,8 +202,8 @@ def test__update_single_same_version__version_updates(
self, client: SpecClient, create_specs, product
):
spec = SpecificationDefinition(
productId=product,
specId="spec1",
product_id=product,
spec_id="spec1",
type=SpecificationType.FUNCTIONAL,
keywords=["work", "reviewed"],
category="Parametric Specs",
Expand Down Expand Up @@ -238,7 +238,7 @@ def test__update_single_same_version__version_updates(
def test__query_product__all_returned(
self, client: SpecClient, create_specs, create_specs_for_query, product
):
request = QuerySpecificationsRequest(productIds=[product])
request = QuerySpecificationsRequest(product_ids=[product])

response = client.query_specs(request)
assert response.specs
Expand Down

0 comments on commit a842173

Please sign in to comment.