port-ocean 0.2.1__py3-none-any.whl → 0.2.2.dev1__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 port-ocean might be problematic. Click here for more details.

port_ocean/config/base.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import os
2
2
  import re
3
3
  from pathlib import Path
4
+ from types import GenericAlias
4
5
  from typing import Any
5
6
 
6
7
  import yaml
@@ -70,18 +71,20 @@ def parse_config(
70
71
  """
71
72
  for key, value in config.items():
72
73
  decamelize_key = decamelize(key)
73
- if isinstance(value, dict):
74
+ if isinstance(value, dict) and settings_model is not None:
74
75
  # If the value is ModelMetaClass typed then its a nested model, and we need to parse it
75
- # If the value is a dict then we need to decamelize the keys and not recurse into the values
76
+ # If the value is a primitive dict then we need to decamelize the keys and not recurse into the values because its no longer part of the model
76
77
  _type = settings_model.__annotations__[decamelize_key]
77
- if isinstance(_type, ModelMetaclass):
78
- existing_data[decamelize_key] = parse_config(
79
- _type, value, existing_data.get(decamelize_key, {})
80
- )
81
- else:
82
- existing_data[decamelize_key] = {
83
- decamelize(k): v for k, v in value.items()
84
- }
78
+ is_primitive_dict_type = _type is dict or (
79
+ isinstance(_type, GenericAlias) and _type.__origin__ is dict
80
+ )
81
+
82
+ if is_primitive_dict_type:
83
+ _type = None
84
+
85
+ existing_data[decamelize_key] = parse_config(
86
+ _type, value, existing_data.get(decamelize_key, {})
87
+ )
85
88
 
86
89
  elif isinstance(value, str):
87
90
  # If the value is a provider, we try to load it from the provider
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.2.1
3
+ Version: 0.2.2.dev1
4
4
  Summary: Port Ocean is a CLI tool for managing your Port projects.
5
5
  Home-page: https://app.getport.io
6
6
  Keywords: ocean,port-ocean,port
@@ -36,7 +36,7 @@ port_ocean/clients/port/mixins/integrations.py,sha256=lKsZHIrfDpAFlPy1X1sXj7eQ6U
36
36
  port_ocean/clients/port/types.py,sha256=NnT1W2H_tZ_9cyEFoDhb90q3apf8p9emkHYspbPoZJQ,593
37
37
  port_ocean/clients/port/utils.py,sha256=T2poQv_8sCs59pIIeynJWe9NZi6pAO0SHhS7KLErnIs,789
38
38
  port_ocean/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
- port_ocean/config/base.py,sha256=cX9On4iC3bLcuzu-yNSCwb7Xzus3y9Iu6kq3uKYpEcw,4617
39
+ port_ocean/config/base.py,sha256=BHx7bsqoD3zK2g9ARuZxe0FPx-VcLkpdI_MKavLkPUM,4735
40
40
  port_ocean/config/dynamic.py,sha256=CIRDnqFUPSnNMLZ-emRCMVAjEQNBlIujhZ7OGwi_aKs,1816
41
41
  port_ocean/config/settings.py,sha256=2QmMrKpAZ3dHVbo-nCoo-GiHFXWwUV1FddKcDWSrjW8,1230
42
42
  port_ocean/consumers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -93,8 +93,8 @@ port_ocean/port_defaults.py,sha256=slubEiM4SJKCzD4bHzf8Rwj3RgsHZXZuYZ0ouhcIQOA,7
93
93
  port_ocean/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
94
  port_ocean/run.py,sha256=Bd6c6qYqQZlZqTLyRWRIkf579NQNqrr-o4mVAnBIISA,2834
95
95
  port_ocean/utils.py,sha256=2a30qmGMSPgsTxfpz2RiI3xDsM0-TkaKAbvJBaYqvCc,1007
96
- port_ocean-0.2.1.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
97
- port_ocean-0.2.1.dist-info/METADATA,sha256=XMGrv5EjSB8lse-4I5DSwLNNhDTpjgGQuOXVvaNsWtA,6356
98
- port_ocean-0.2.1.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
99
- port_ocean-0.2.1.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
100
- port_ocean-0.2.1.dist-info/RECORD,,
96
+ port_ocean-0.2.2.dev1.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
97
+ port_ocean-0.2.2.dev1.dist-info/METADATA,sha256=-WGpPZQK05oxsgS4F17uTK5Zeq0NkW0spwPaTFj01OQ,6361
98
+ port_ocean-0.2.2.dev1.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
99
+ port_ocean-0.2.2.dev1.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
100
+ port_ocean-0.2.2.dev1.dist-info/RECORD,,