soia-client 1.0.23__tar.gz → 1.0.25__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {soia_client-1.0.23 → soia_client-1.0.25}/PKG-INFO +1 -1
- {soia_client-1.0.23 → soia_client-1.0.25}/pyproject.toml +1 -1
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/service_client.py +0 -1
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/structs.py +1 -1
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/timestamp.py +4 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia_client.egg-info/PKG-INFO +1 -1
- {soia_client-1.0.23 → soia_client-1.0.25}/tests/test_module_initializer.py +1 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/tests/test_timestamp.py +4 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/LICENSE +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/README.md +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/setup.cfg +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/__init__.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/__init__.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/arrays.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/enums.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/function_maker.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/keyed_items.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/method.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/never.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/optionals.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/primitives.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/repr.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/serializer.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/serializers.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/service.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_impl/type_adapter.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_module_initializer.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/_spec.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia/reflection.py +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia_client.egg-info/SOURCES.txt +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia_client.egg-info/dependency_links.txt +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/soia_client.egg-info/top_level.txt +0 -0
- {soia_client-1.0.23 → soia_client-1.0.25}/tests/test_serializers.py +0 -0
@@ -676,7 +676,7 @@ def _make_from_json_fn(
|
|
676
676
|
name = field.field.name
|
677
677
|
lvalue = f"ret.{field.field.attribute}"
|
678
678
|
builder.append_ln(f' if "{name}" in json:')
|
679
|
-
builder.append_ln(f" array_len = {field.field.number}")
|
679
|
+
builder.append_ln(f" array_len = {field.field.number + 1}")
|
680
680
|
builder.append_ln(
|
681
681
|
f" {lvalue} = ",
|
682
682
|
field.type.from_json_expr(f'json["{name}"]'),
|
@@ -24,6 +24,10 @@ class Timestamp:
|
|
24
24
|
def from_unix_seconds(unix_seconds: float) -> "Timestamp":
|
25
25
|
return Timestamp(unix_millis=round(unix_seconds * 1000))
|
26
26
|
|
27
|
+
@staticmethod
|
28
|
+
def from_iso_format(date_string: str) -> "Timestamp":
|
29
|
+
return Timestamp.from_datetime(datetime.datetime.fromisoformat(date_string))
|
30
|
+
|
27
31
|
@staticmethod
|
28
32
|
def from_datetime(dt: datetime.datetime) -> "Timestamp":
|
29
33
|
return Timestamp.from_unix_seconds(dt.timestamp())
|
@@ -518,6 +518,7 @@ class ModuleInitializerTestCase(unittest.TestCase):
|
|
518
518
|
point = point_cls.SERIALIZER.from_json_code('{"x":1,"y":2}')
|
519
519
|
self.assertEqual(point.x, 1.0)
|
520
520
|
self.assertIsInstance(point.x, float)
|
521
|
+
self.assertEqual(point._array_len, 3)
|
521
522
|
|
522
523
|
def test_point_with_unrecognized_and_removed_fields(self):
|
523
524
|
point_cls = self.init_test_module()["Point"]
|
@@ -24,6 +24,10 @@ class TimestampTestCase(unittest.TestCase):
|
|
24
24
|
ts = Timestamp.from_datetime(datetime.fromtimestamp(200, tz=timezone.utc))
|
25
25
|
self.assertEqual(ts.unix_millis, 200000)
|
26
26
|
|
27
|
+
def test_from_iso_format(self):
|
28
|
+
ts = Timestamp.from_iso_format("1970-01-01T00:03:20Z")
|
29
|
+
self.assertEqual(ts.unix_millis, 200000)
|
30
|
+
|
27
31
|
def test_epoch(self):
|
28
32
|
self.assertEqual(Timestamp.EPOCH.unix_millis, 0)
|
29
33
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|