payi 0.1.0a100__py3-none-any.whl → 0.1.0a102__py3-none-any.whl
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.
Potentially problematic release.
This version of payi might be problematic. Click here for more details.
- payi/_models.py +1 -1
- payi/_version.py +1 -1
- payi/lib/instrument.py +45 -32
- {payi-0.1.0a100.dist-info → payi-0.1.0a102.dist-info}/METADATA +1 -1
- {payi-0.1.0a100.dist-info → payi-0.1.0a102.dist-info}/RECORD +7 -7
- {payi-0.1.0a100.dist-info → payi-0.1.0a102.dist-info}/WHEEL +0 -0
- {payi-0.1.0a100.dist-info → payi-0.1.0a102.dist-info}/licenses/LICENSE +0 -0
payi/_models.py
CHANGED
|
@@ -439,7 +439,7 @@ def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]
|
|
|
439
439
|
type_ = type_.__value__ # type: ignore[unreachable]
|
|
440
440
|
|
|
441
441
|
# unwrap `Annotated[T, ...]` -> `T`
|
|
442
|
-
if metadata is not None:
|
|
442
|
+
if metadata is not None and len(metadata) > 0:
|
|
443
443
|
meta: tuple[Any, ...] = tuple(metadata)
|
|
444
444
|
elif is_annotated_type(type_):
|
|
445
445
|
meta = get_args(type_)[1:]
|
payi/_version.py
CHANGED
payi/lib/instrument.py
CHANGED
|
@@ -673,29 +673,58 @@ class _PayiInstrumentor:
|
|
|
673
673
|
parent_use_case_name = parent_context.get("use_case_name", None)
|
|
674
674
|
parent_use_case_id = parent_context.get("use_case_id", None)
|
|
675
675
|
parent_use_case_version = parent_context.get("use_case_version", None)
|
|
676
|
+
parent_use_case_step = parent_context.get("use_case_step", None)
|
|
677
|
+
|
|
678
|
+
assign_use_case_values = False
|
|
676
679
|
|
|
677
680
|
if use_case_name is None:
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
681
|
+
if parent_use_case_name:
|
|
682
|
+
# If no use_case_name specified, use previous values
|
|
683
|
+
context["use_case_name"] = parent_use_case_name
|
|
684
|
+
assign_use_case_values = True
|
|
682
685
|
elif len(use_case_name) == 0:
|
|
683
686
|
# Empty string explicitly blocks inheriting from the parent state
|
|
684
687
|
context["use_case_name"] = None
|
|
685
688
|
context["use_case_id"] = None
|
|
686
689
|
context["use_case_version"] = None
|
|
687
690
|
context["use_case_step"] = None
|
|
691
|
+
context["use_case_properties"] = None
|
|
688
692
|
else:
|
|
689
693
|
if use_case_name == parent_use_case_name:
|
|
690
694
|
# Same use case name, use previous ID unless new one specified
|
|
691
695
|
context["use_case_name"] = use_case_name
|
|
692
|
-
context["use_case_id"] = use_case_id if use_case_id else parent_use_case_id
|
|
693
|
-
context["use_case_version"] = use_case_version if use_case_version else parent_use_case_version
|
|
694
696
|
else:
|
|
695
|
-
# Different use case name, use specified ID or generate one
|
|
696
697
|
context["use_case_name"] = use_case_name
|
|
697
|
-
|
|
698
|
-
|
|
698
|
+
|
|
699
|
+
# Different use case name, use specified ID or generate one.
|
|
700
|
+
# By assigning to a new value to parent_use_case_id we keep the assignment logic below simple and consistent with
|
|
701
|
+
# assign the caller's use_case_id if specified or the newly generated one.
|
|
702
|
+
# The use case id stored in the parent context is not mutated.
|
|
703
|
+
parent_use_case_id = str(uuid.uuid4())
|
|
704
|
+
|
|
705
|
+
assign_use_case_values = True
|
|
706
|
+
|
|
707
|
+
if assign_use_case_values:
|
|
708
|
+
context["use_case_id"] = use_case_id if use_case_id else parent_use_case_id
|
|
709
|
+
context["use_case_version"] = use_case_version if use_case_version else parent_use_case_version
|
|
710
|
+
context["use_case_step"] = use_case_step if use_case_step else parent_use_case_step
|
|
711
|
+
|
|
712
|
+
parent_use_case_properties = parent_context.get("use_case_properties", None)
|
|
713
|
+
if use_case_properties is not None:
|
|
714
|
+
if not use_case_properties:
|
|
715
|
+
# an empty dictionary explicitly blocks inheriting from the parent state
|
|
716
|
+
context["use_case_properties"] = None
|
|
717
|
+
else:
|
|
718
|
+
if parent_use_case_properties:
|
|
719
|
+
# merge dictionaries, child overrides parent keys
|
|
720
|
+
merged = parent_use_case_properties.copy()
|
|
721
|
+
merged.update(use_case_properties)
|
|
722
|
+
context["use_case_properties"] = merged
|
|
723
|
+
else:
|
|
724
|
+
context["use_case_properties"] = use_case_properties.copy()
|
|
725
|
+
elif parent_use_case_properties:
|
|
726
|
+
# use the parent use_case_properties if it exists
|
|
727
|
+
context["use_case_properties"] = parent_use_case_properties.copy()
|
|
699
728
|
|
|
700
729
|
parent_limit_ids = parent_context.get("limit_ids", None)
|
|
701
730
|
if limit_ids is None:
|
|
@@ -706,7 +735,7 @@ class _PayiInstrumentor:
|
|
|
706
735
|
context["limit_ids"] = None
|
|
707
736
|
else:
|
|
708
737
|
# union of new and parent lists if the parent context contains limit ids
|
|
709
|
-
context["limit_ids"] = list(set(limit_ids) | set(parent_limit_ids)) if parent_limit_ids else limit_ids
|
|
738
|
+
context["limit_ids"] = list(set(limit_ids) | set(parent_limit_ids)) if parent_limit_ids else limit_ids.copy()
|
|
710
739
|
|
|
711
740
|
parent_user_id = parent_context.get("user_id", None)
|
|
712
741
|
if user_id is None:
|
|
@@ -721,20 +750,22 @@ class _PayiInstrumentor:
|
|
|
721
750
|
parent_request_tags = parent_context.get("request_tags", None)
|
|
722
751
|
if request_tags is not None:
|
|
723
752
|
if len(request_tags) == 0:
|
|
753
|
+
# caller passing an empty list explicitly blocks inheriting from the parent state
|
|
724
754
|
context["request_tags"] = None
|
|
725
755
|
else:
|
|
726
756
|
if parent_request_tags:
|
|
727
757
|
# union of new and parent lists if the parent context contains request tags
|
|
728
758
|
context["request_tags"] = list(set(request_tags) | set(parent_request_tags))
|
|
729
759
|
else:
|
|
730
|
-
context["request_tags"] = request_tags
|
|
760
|
+
context["request_tags"] = request_tags.copy()
|
|
731
761
|
elif parent_request_tags:
|
|
732
762
|
# use the parent request_tags if it exists
|
|
733
|
-
context["request_tags"] = parent_request_tags
|
|
763
|
+
context["request_tags"] = parent_request_tags.copy()
|
|
734
764
|
|
|
735
765
|
parent_request_properties = parent_context.get("request_properties", None)
|
|
736
766
|
if request_properties is not None:
|
|
737
767
|
if not request_properties:
|
|
768
|
+
# an empty dictionary explicitly blocks inheriting from the parent state
|
|
738
769
|
context["request_properties"] = None
|
|
739
770
|
else:
|
|
740
771
|
if parent_request_properties:
|
|
@@ -743,29 +774,11 @@ class _PayiInstrumentor:
|
|
|
743
774
|
merged.update(request_properties)
|
|
744
775
|
context["request_properties"] = merged
|
|
745
776
|
else:
|
|
746
|
-
context["request_properties"] = request_properties
|
|
777
|
+
context["request_properties"] = request_properties.copy()
|
|
747
778
|
elif parent_request_properties:
|
|
748
779
|
# use the parent request_properties if it exists
|
|
749
|
-
context["request_properties"] = parent_request_properties
|
|
750
|
-
|
|
751
|
-
parent_use_case_properties = parent_context.get("use_case_properties", None)
|
|
752
|
-
if use_case_properties is not None:
|
|
753
|
-
if not use_case_properties:
|
|
754
|
-
context["use_case_properties"] = None
|
|
755
|
-
else:
|
|
756
|
-
if parent_use_case_properties:
|
|
757
|
-
# merge dictionaries, child overrides parent keys
|
|
758
|
-
merged = parent_use_case_properties.copy()
|
|
759
|
-
merged.update(use_case_properties)
|
|
760
|
-
context["use_case_properties"] = merged
|
|
761
|
-
else:
|
|
762
|
-
context["use_case_properties"] = use_case_properties
|
|
763
|
-
elif parent_use_case_properties:
|
|
764
|
-
# use the parent use_case_properties if it exists
|
|
765
|
-
context["use_case_properties"] = parent_use_case_properties
|
|
780
|
+
context["request_properties"] = parent_request_properties.copy()
|
|
766
781
|
|
|
767
|
-
if use_case_step and (context["use_case_name"] or context["use_case_id"]):
|
|
768
|
-
context["use_case_step"] = use_case_step
|
|
769
782
|
if price_as_category:
|
|
770
783
|
context["price_as_category"] = price_as_category
|
|
771
784
|
if price_as_resource:
|
|
@@ -5,13 +5,13 @@ payi/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
|
|
|
5
5
|
payi/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
|
6
6
|
payi/_exceptions.py,sha256=ItygKNrNXIVY0H6LsGVZvFuAHB3Vtm_VZXmWzCnpHy0,3216
|
|
7
7
|
payi/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
|
|
8
|
-
payi/_models.py,sha256=
|
|
8
|
+
payi/_models.py,sha256=aRCuUozbf1yNMK9XbMmxcgxDJYogijGTtQEr3g_wbyA,29316
|
|
9
9
|
payi/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
|
|
10
10
|
payi/_resource.py,sha256=j2jIkTr8OIC8sU6-05nxSaCyj4MaFlbZrwlyg4_xJos,1088
|
|
11
11
|
payi/_response.py,sha256=rh9oJAvCKcPwQFm4iqH_iVrmK8bNx--YP_A2a4kN1OU,28776
|
|
12
12
|
payi/_streaming.py,sha256=Z_wIyo206T6Jqh2rolFg2VXZgX24PahLmpURp0-NssU,10092
|
|
13
13
|
payi/_types.py,sha256=7jE5MoQQFVoVxw5vVzvZ2Ao0kcjfNOGsBgyJfLBEnMo,6195
|
|
14
|
-
payi/_version.py,sha256=
|
|
14
|
+
payi/_version.py,sha256=dpeEOxkAcBoml6b4qgFF0EEIN1ffA-sOpXbUN55AIP0,166
|
|
15
15
|
payi/pagination.py,sha256=k2356QGPOUSjRF2vHpwLBdF6P-2vnQzFfRIJQAHGQ7A,1258
|
|
16
16
|
payi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
payi/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
|
|
@@ -33,7 +33,7 @@ payi/lib/Stopwatch.py,sha256=7OJlxvr2Jyb6Zr1LYCYKczRB7rDVKkIR7gc4YoleNdE,764
|
|
|
33
33
|
payi/lib/VertexInstrumentor.py,sha256=OWuMPiW4LdLhj6DSAAy5qZiosVo8DSAuFWGxYpEucoE,7431
|
|
34
34
|
payi/lib/VertexRequest.py,sha256=edv14HR5QtKaf07gmOqzWdhoJGdWCos85uCZASwsGL4,11710
|
|
35
35
|
payi/lib/helpers.py,sha256=FPzNSSHGf9bgD6CanB7yVx_U8t4lm2c0jlZKrsziYlc,4242
|
|
36
|
-
payi/lib/instrument.py,sha256=
|
|
36
|
+
payi/lib/instrument.py,sha256=TR4RBx5tlmTkerD4A4QN1Cr9dH_vQ-OZ_NjI5bz-cV0,73551
|
|
37
37
|
payi/lib/version_helper.py,sha256=v0lC3kuaXn6PBDolE3mkmwJiA8Ot3z4RkVR7wlBuZCs,540
|
|
38
38
|
payi/resources/__init__.py,sha256=B2bn1ZfCf6TbHlzZvy5TpFPtALnFcBRPYVKQH3S5qfQ,2457
|
|
39
39
|
payi/resources/ingest.py,sha256=Ti7JkuHvdGSSyMiyI6PHBRlM1fKRkKdR5sQhs5t9v04,22980
|
|
@@ -133,7 +133,7 @@ payi/types/use_cases/definitions/kpi_retrieve_response.py,sha256=uQXliSvS3k-yDYw
|
|
|
133
133
|
payi/types/use_cases/definitions/kpi_update_params.py,sha256=jbawdWAdMnsTWVH0qfQGb8W7_TXe3lq4zjSRu44d8p8,373
|
|
134
134
|
payi/types/use_cases/definitions/kpi_update_response.py,sha256=zLyEoT0S8d7XHsnXZYT8tM7yDw0Aze0Mk-_Z6QeMtc8,459
|
|
135
135
|
payi/types/use_cases/definitions/limit_config_create_params.py,sha256=pzQza_16N3z8cFNEKr6gPbFvuGFrwNuGxAYb--Kbo2M,449
|
|
136
|
-
payi-0.1.
|
|
137
|
-
payi-0.1.
|
|
138
|
-
payi-0.1.
|
|
139
|
-
payi-0.1.
|
|
136
|
+
payi-0.1.0a102.dist-info/METADATA,sha256=K_33DsmVANkinL4XIRSpbXF_ZnK0b5AMoThrdGSsCYw,16290
|
|
137
|
+
payi-0.1.0a102.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
138
|
+
payi-0.1.0a102.dist-info/licenses/LICENSE,sha256=CQt03aM-P4a3Yg5qBg3JSLVoQS3smMyvx7tYg_6V7Gk,11334
|
|
139
|
+
payi-0.1.0a102.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|