mostlyai 5.5.0__tar.gz → 5.6.0__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.
Files changed (89) hide show
  1. {mostlyai-5.5.0 → mostlyai-5.6.0}/PKG-INFO +3 -3
  2. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/__init__.py +1 -1
  3. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/auto_detect.py +4 -0
  4. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/base.py +8 -6
  5. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/hive.py +4 -0
  6. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/metadata_objects.py +58 -58
  7. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/non_context.py +323 -184
  8. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/jobs.py +12 -9
  9. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/step_finalize_generation.py +84 -22
  10. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/step_finalize_training.py +161 -36
  11. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/domain.py +35 -1
  12. {mostlyai-5.5.0 → mostlyai-5.6.0}/pyproject.toml +3 -3
  13. {mostlyai-5.5.0 → mostlyai-5.6.0}/.gitignore +0 -0
  14. {mostlyai-5.5.0 → mostlyai-5.6.0}/LICENSE +0 -0
  15. {mostlyai-5.5.0 → mostlyai-5.6.0}/README.md +0 -0
  16. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/__init__.py +0 -0
  17. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/base.py +0 -0
  18. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/context.py +0 -0
  19. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/conversions.py +0 -0
  20. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/__init__.py +0 -0
  21. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/bigquery.py +0 -0
  22. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/databricks.py +0 -0
  23. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/mssql.py +0 -0
  24. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/mysql.py +0 -0
  25. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/oracle.py +0 -0
  26. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/postgresql.py +0 -0
  27. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/redshift.py +0 -0
  28. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/snowflake.py +0 -0
  29. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/sqlite.py +0 -0
  30. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/db/types_coercion.py +0 -0
  31. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/dtype.py +0 -0
  32. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/exceptions.py +0 -0
  33. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/__init__.py +0 -0
  34. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/base.py +0 -0
  35. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/container/__init__.py +0 -0
  36. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/container/aws.py +0 -0
  37. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/container/azure.py +0 -0
  38. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/container/bucket_based.py +0 -0
  39. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/container/gcs.py +0 -0
  40. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/container/minio.py +0 -0
  41. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/table/__init__.py +0 -0
  42. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/table/csv.py +0 -0
  43. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/table/feather.py +0 -0
  44. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/table/json.py +0 -0
  45. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/table/parquet.py +0 -0
  46. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/file/utils.py +0 -0
  47. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/language_model.py +0 -0
  48. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/progress_callback.py +0 -0
  49. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/pull.py +0 -0
  50. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/pull_context.py +0 -0
  51. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/pull_utils.py +0 -0
  52. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/push.py +0 -0
  53. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/util/__init__.py +0 -0
  54. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/util/common.py +0 -0
  55. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_data/util/kerberos.py +0 -0
  56. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/__init__.py +0 -0
  57. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/cli.py +0 -0
  58. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/connectors.py +0 -0
  59. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/__init__.py +0 -0
  60. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/migration.py +0 -0
  61. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/plan.py +0 -0
  62. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/step_analyze_training_data.py +0 -0
  63. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/step_create_data_report.py +0 -0
  64. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/step_create_model_report.py +0 -0
  65. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/step_deliver_data.py +0 -0
  66. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/step_encode_training_data.py +0 -0
  67. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/step_generate_data.py +0 -0
  68. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/step_generate_model_report_data.py +0 -0
  69. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/step_pull_training_data.py +0 -0
  70. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/execution/step_train_model.py +0 -0
  71. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/generators.py +0 -0
  72. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/progress.py +0 -0
  73. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/routes.py +0 -0
  74. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/server.py +0 -0
  75. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/storage.py +0 -0
  76. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/_local/synthetic_datasets.py +0 -0
  77. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/__init__.py +0 -0
  78. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/_base_utils.py +0 -0
  79. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/_naming_conventions.py +0 -0
  80. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/_utils.py +0 -0
  81. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/api.py +0 -0
  82. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/artifacts.py +0 -0
  83. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/base.py +0 -0
  84. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/connectors.py +0 -0
  85. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/datasets.py +0 -0
  86. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/exceptions.py +0 -0
  87. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/generators.py +0 -0
  88. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/client/synthetic_datasets.py +0 -0
  89. {mostlyai-5.5.0 → mostlyai-5.6.0}/mostlyai/sdk/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mostlyai
3
- Version: 5.5.0
3
+ Version: 5.6.0
4
4
  Summary: Synthetic Data SDK
5
5
  Project-URL: homepage, https://app.mostly.ai/
6
6
  Project-URL: repository, https://github.com/mostly-ai/mostlyai
@@ -60,7 +60,7 @@ Requires-Dist: fastapi<0.116,>=0.115.6; extra == 'local'
60
60
  Requires-Dist: filelock>=3.16.1; extra == 'local'
61
61
  Requires-Dist: gcsfs>=2023.1.0; extra == 'local'
62
62
  Requires-Dist: joblib>=1.4.2; extra == 'local'
63
- Requires-Dist: mostlyai-engine==1.7.0; extra == 'local'
63
+ Requires-Dist: mostlyai-engine==2.0.0; extra == 'local'
64
64
  Requires-Dist: mostlyai-qa==1.9.8; extra == 'local'
65
65
  Requires-Dist: networkx<4,>=3.0; extra == 'local'
66
66
  Requires-Dist: openpyxl>=3.1.5; extra == 'local'
@@ -82,7 +82,7 @@ Requires-Dist: fastapi<0.116,>=0.115.6; extra == 'local-gpu'
82
82
  Requires-Dist: filelock>=3.16.1; extra == 'local-gpu'
83
83
  Requires-Dist: gcsfs>=2023.1.0; extra == 'local-gpu'
84
84
  Requires-Dist: joblib>=1.4.2; extra == 'local-gpu'
85
- Requires-Dist: mostlyai-engine[gpu]==1.7.0; extra == 'local-gpu'
85
+ Requires-Dist: mostlyai-engine[gpu]==2.0.0; extra == 'local-gpu'
86
86
  Requires-Dist: mostlyai-qa==1.9.8; extra == 'local-gpu'
87
87
  Requires-Dist: networkx<4,>=3.0; extra == 'local-gpu'
88
88
  Requires-Dist: openpyxl>=3.1.5; extra == 'local-gpu'
@@ -49,4 +49,4 @@ For more information, visit: https://mostly-ai.github.io/mostlyai/
49
49
  from mostlyai.sdk.client.api import MostlyAI
50
50
 
51
51
  __all__ = ["MostlyAI"]
52
- __version__ = "5.5.0" # Do not set this manually. Use poetry version [params].
52
+ __version__ = "5.6.0" # Do not set this manually. Use poetry version [params].
@@ -84,6 +84,10 @@ def auto_detect_encoding_type(x: pd.Series):
84
84
  x = x.astype(str)
85
85
  x = x[x.str.strip() != ""] # filter out empty and whitespace-only strings
86
86
 
87
+ # if all values are null or empty, default to categorical
88
+ if len(x) == 0:
89
+ return ModelEncodingType.tabular_categorical
90
+
87
91
  # if all non-null values can be converted to datetime -> datetime encoding
88
92
  if safe_convert_datetime(x).notna().all():
89
93
  return ModelEncodingType.tabular_datetime
@@ -1131,10 +1131,13 @@ class SqlAlchemyTable(DBTable, abc.ABC):
1131
1131
  fetch_chunk_size = fetch_chunk_size if fetch_chunk_size is not None else 100_000
1132
1132
  yield_chunk_size = yield_chunk_size if yield_chunk_size is not None else fetch_chunk_size
1133
1133
  stmt = self._sa_select(columns)
1134
- with self.container.use_sa_engine() as sa_engine:
1135
- chunk_idx = 0
1136
- total_time = 0
1137
- session = sessionmaker(bind=sa_engine)()
1134
+ chunk_idx = 0
1135
+ total_time = 0
1136
+ # use context managers to ensure proper cleanup of engine and session
1137
+ with (
1138
+ self.container.use_sa_engine() as sa_engine,
1139
+ sessionmaker(bind=sa_engine)() as session,
1140
+ ):
1138
1141
  results_generator = None
1139
1142
  try:
1140
1143
  conn = session.connection()
@@ -1162,10 +1165,9 @@ class SqlAlchemyTable(DBTable, abc.ABC):
1162
1165
  yield chunks_df
1163
1166
  _LOG.info(f"finished reading {chunk_idx} chunks in {time.time() - t00:.2f}s (strategy=scan)")
1164
1167
  finally:
1165
- # explicitly close resources to prevent connection leaks
1168
+ # explicitly close the results generator to prevent connection leaks
1166
1169
  if results_generator is not None:
1167
1170
  results_generator.close()
1168
- session.close()
1169
1171
 
1170
1172
  def is_column_indexed(self, column: str) -> bool:
1171
1173
  with self.container.use_sa_engine() as sa_engine:
@@ -172,6 +172,10 @@ class HiveContainer(SqlAlchemyContainer):
172
172
  def table_class(cls):
173
173
  return HiveTable
174
174
 
175
+ def use_sa_engine(self, mode="read_data", dispose=False):
176
+ # always keep the engine alive to reuse the cached connection
177
+ return super().use_sa_engine(mode=mode, dispose=dispose)
178
+
175
179
  def does_database_exist(self) -> bool:
176
180
  with self.init_sa_connection("db_exist_check") as connection:
177
181
  result = connection.execute(sa.text("SHOW DATABASES"))
@@ -14,7 +14,8 @@
14
14
 
15
15
  from typing import Annotated, TypeVar
16
16
 
17
- from pydantic import BaseModel, ConfigDict, Field, field_validator
17
+ from pydantic import AliasChoices, BaseModel, ConfigDict, Field, field_validator
18
+ from pydantic.alias_generators import to_camel
18
19
  from pydantic.json_schema import SkipJsonSchema
19
20
 
20
21
  T = TypeVar("T")
@@ -22,49 +23,53 @@ T = TypeVar("T")
22
23
  Nullable = T | SkipJsonSchema[None]
23
24
 
24
25
 
25
- class SslCertificates(BaseModel):
26
+ class CustomBaseModel(BaseModel):
27
+ model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
28
+
29
+
30
+ class SslCertificates(CustomBaseModel):
26
31
  # SSL for Postgres
27
- root_certificate: Nullable[str] = Field(None, alias="rootCertificate", description="Encrypted root certificate.")
28
- ssl_certificate: Nullable[str] = Field(None, alias="sslCertificate", description="Encrypted client certificate.")
29
- ssl_certificate_key: Nullable[str] = Field(None, alias="sslCertificateKey", description="Encrypted client key.")
32
+ root_certificate: Nullable[str] = Field(None, description="Encrypted root certificate.")
33
+ ssl_certificate: Nullable[str] = Field(None, description="Encrypted client certificate.")
34
+ ssl_certificate_key: Nullable[str] = Field(None, description="Encrypted client key.")
30
35
  # SSL for Hive
31
36
  keystore: Nullable[str] = Field(None, description="Encrypted keystore.")
32
- keystore_password: Nullable[str] = Field(None, alias="keystorePassword", description="Encrypted keystore password.")
33
- ca_certificate: Nullable[str] = Field(None, alias="caCertificate", description="Encrypted CA certificate.")
37
+ keystore_password: Nullable[str] = Field(None, description="Encrypted keystore password.")
38
+ ca_certificate: Nullable[str] = Field(None, description="Encrypted CA certificate.")
34
39
 
35
40
 
36
- class AwsS3FileContainerParameters(BaseModel):
37
- access_key: Nullable[str] = Field(None, alias="accessKey")
38
- secret_key: Nullable[str] = Field(None, alias="secretKey")
39
- endpoint_url: Nullable[str] = Field(None, alias="endpointUrl")
41
+ class AwsS3FileContainerParameters(CustomBaseModel):
42
+ access_key: Nullable[str] = Field(None)
43
+ secret_key: Nullable[str] = Field(None)
44
+ endpoint_url: Nullable[str] = Field(None)
40
45
  # SSL
41
- ssl_enabled: Nullable[bool] = Field(False, alias="sslEnabled")
42
- ca_certificate: Nullable[str] = Field(None, alias="caCertificate", description="Encrypted CA certificate.")
46
+ ssl_enabled: Nullable[bool] = Field(False)
47
+ ca_certificate: Nullable[str] = Field(None, description="Encrypted CA certificate.")
43
48
 
44
49
 
45
- class AzureBlobFileContainerParameters(BaseModel):
46
- account_name: Nullable[str] = Field(None, alias="accountName")
47
- account_key: Nullable[str] = Field(None, alias="accountKey")
48
- client_id: Nullable[str] = Field(None, alias="clientId")
49
- client_secret: Nullable[str] = Field(None, alias="clientSecret")
50
- tenant_id: Nullable[str] = Field(None, alias="tenantId")
50
+ class AzureBlobFileContainerParameters(CustomBaseModel):
51
+ account_name: Nullable[str] = Field(None)
52
+ account_key: Nullable[str] = Field(None)
53
+ client_id: Nullable[str] = Field(None)
54
+ client_secret: Nullable[str] = Field(None)
55
+ tenant_id: Nullable[str] = Field(None)
51
56
 
52
57
 
53
- class GcsContainerParameters(BaseModel):
54
- key_file: Nullable[str] = Field(None, alias="keyFile")
58
+ class GcsContainerParameters(CustomBaseModel):
59
+ key_file: Nullable[str] = Field(None)
55
60
 
56
61
 
57
- class MinIOContainerParameters(BaseModel):
58
- endpoint_url: Nullable[str] = Field(None, alias="endpointUrl")
59
- access_key: Nullable[str] = Field(None, alias="accessKey")
60
- secret_key: Nullable[str] = Field(None, alias="secretKey")
62
+ class MinIOContainerParameters(CustomBaseModel):
63
+ endpoint_url: Nullable[str] = Field(None)
64
+ access_key: Nullable[str] = Field(None)
65
+ secret_key: Nullable[str] = Field(None)
61
66
 
62
67
 
63
- class LocalFileContainerParameters(BaseModel):
68
+ class LocalFileContainerParameters(CustomBaseModel):
64
69
  pass
65
70
 
66
71
 
67
- class SqlAlchemyContainerParameters(BaseModel):
72
+ class SqlAlchemyContainerParameters(CustomBaseModel):
68
73
  model_config = ConfigDict(extra="allow")
69
74
 
70
75
  username: Nullable[str] = None
@@ -73,22 +78,21 @@ class SqlAlchemyContainerParameters(BaseModel):
73
78
  port: Nullable[str | int] = None
74
79
  dbname: Nullable[str] = Field(None, alias="database")
75
80
  # SSL
76
- ssl_enabled: Nullable[bool] = Field(False, alias="sslEnabled")
77
- root_certificate: Nullable[str] = Field(None, alias="rootCertificate", description="Encrypted root certificate.")
78
- ssl_certificate: Nullable[str] = Field(None, alias="sslCertificate", description="Encrypted client certificate.")
79
- ssl_certificate_key: Nullable[str] = Field(None, alias="sslCertificateKey", description="Encrypted client key.")
81
+ ssl_enabled: Nullable[bool] = Field(False)
82
+ root_certificate: Nullable[str] = Field(None, description="Encrypted root certificate.")
83
+ ssl_certificate: Nullable[str] = Field(None, description="Encrypted client certificate.")
84
+ ssl_certificate_key: Nullable[str] = Field(None, description="Encrypted client key.")
80
85
  keystore: Nullable[str] = Field(None, description="Encrypted keystore.")
81
- keystore_password: Nullable[str] = Field(None, alias="keystorePassword", description="Encrypted keystore password.")
82
- ca_certificate: Nullable[str] = Field(None, alias="caCertificate", description="Encrypted CA certificate.")
86
+ keystore_password: Nullable[str] = Field(None, description="Encrypted keystore password.")
87
+ ca_certificate: Nullable[str] = Field(None, description="Encrypted CA certificate.")
83
88
  # Kerberos
84
- kerberos_enabled: Nullable[bool] = Field(False, alias="kerberosEnabled")
85
- kerberos_kdc_host: Nullable[str] = Field(None, alias="kerberosKdcHost")
86
- kerberos_krb5_conf: Nullable[str] = Field(None, alias="kerberosKrb5Conf")
87
- kerberos_service_principal: Nullable[str] = Field(None, alias="kerberosServicePrincipal")
88
- kerberos_client_principal: Nullable[str] = Field(None, alias="kerberosClientPrincipal")
89
+ kerberos_enabled: Nullable[bool] = Field(False)
90
+ kerberos_kdc_host: Nullable[str] = Field(None)
91
+ kerberos_krb5_conf: Nullable[str] = Field(None)
92
+ kerberos_service_principal: Nullable[str] = Field(None)
93
+ kerberos_client_principal: Nullable[str] = Field(None)
89
94
  kerberos_keytab: Nullable[str] = Field(
90
95
  None,
91
- alias="kerberosKeytab",
92
96
  description="Encrypted content of keytab file of client principal if it is defined. Otherwise, it is the one for service principal.",
93
97
  )
94
98
 
@@ -106,7 +110,7 @@ class SqlAlchemyContainerParameters(BaseModel):
106
110
 
107
111
 
108
112
  class OracleContainerParameters(SqlAlchemyContainerParameters):
109
- connection_type: Nullable[str] = Field("SID", alias="connectionType")
113
+ connection_type: Nullable[str] = Field("SID")
110
114
 
111
115
 
112
116
  class SnowflakeContainerParameters(SqlAlchemyContainerParameters):
@@ -115,64 +119,60 @@ class SnowflakeContainerParameters(SqlAlchemyContainerParameters):
115
119
 
116
120
 
117
121
  class BigQueryContainerParameters(SqlAlchemyContainerParameters):
118
- password: Nullable[str] = Field(None, alias="keyFile")
122
+ password: Nullable[str] = Field(None, validation_alias=AliasChoices("keyFile", "key_file"))
119
123
 
120
124
 
121
125
  class DatabricksContainerParameters(SqlAlchemyContainerParameters):
122
- password: Nullable[str] = Field(None, alias="accessToken")
126
+ password: Nullable[str] = Field(None, validation_alias=AliasChoices("accessToken", "access_token"))
123
127
  dbname: Nullable[str] = Field(None, alias="catalog")
124
- http_path: Nullable[str] = Field(None, alias="httpPath")
125
- client_id: Nullable[str] = Field(None, alias="clientId")
126
- client_secret: Nullable[str] = Field(None, alias="clientSecret")
127
- tenant_id: Nullable[str] = Field(None, alias="tenantId")
128
+ http_path: Nullable[str] = Field(None)
129
+ client_id: Nullable[str] = Field(None)
130
+ client_secret: Nullable[str] = Field(None)
131
+ tenant_id: Nullable[str] = Field(None)
128
132
 
129
133
 
130
- class ConnectionResponse(BaseModel):
134
+ class ConnectionResponse(CustomBaseModel):
131
135
  connection_succeeded: bool = Field(
132
136
  False,
133
- alias="connectionSucceeded",
134
137
  description="Boolean that shows the connection status",
135
138
  )
136
139
  message: str = Field("", description="A message describing the result of the test.")
137
140
 
138
141
 
139
- class LocationsResponse(BaseModel):
142
+ class LocationsResponse(CustomBaseModel):
140
143
  locations: list[str] = Field(None, description="The list of locations")
141
144
 
142
145
 
143
- class ColumnSchema(BaseModel):
146
+ class ColumnSchema(CustomBaseModel):
144
147
  name: Nullable[str] = None
145
- original_data_type: Annotated[Nullable[str], Field(alias="originalDataType")] = None
146
- default_model_encoding_type: Annotated[Nullable[str], Field(alias="defaultModelEncodingType")] = None
148
+ original_data_type: Annotated[Nullable[str], Field()] = None
149
+ default_model_encoding_type: Annotated[Nullable[str], Field()] = None
147
150
 
148
151
 
149
- class ConstraintSchema(BaseModel):
152
+ class ConstraintSchema(CustomBaseModel):
150
153
  foreign_key: Annotated[
151
154
  Nullable[str],
152
155
  Field(
153
- alias="foreignKey",
154
156
  description="The name of the foreign key column within this table.",
155
157
  ),
156
158
  ] = None
157
159
  referenced_table: Annotated[
158
160
  Nullable[str],
159
- Field(alias="referencedTable", description="The name of the reference table."),
161
+ Field(description="The name of the reference table."),
160
162
  ] = None
161
163
 
162
164
 
163
- class TableSchema(BaseModel):
165
+ class TableSchema(CustomBaseModel):
164
166
  name: Annotated[Nullable[str], Field(description="The name of the table.")] = None
165
167
  totalRows: Annotated[
166
168
  Nullable[int],
167
169
  Field(
168
- alias="totalRows",
169
170
  description="The total number of rows in the table.",
170
171
  ),
171
172
  ] = None
172
173
  primary_key: Annotated[
173
174
  Nullable[str],
174
175
  Field(
175
- alias="primaryKey",
176
176
  description="The name of a primary key column. Only applicable for DB connectors.",
177
177
  ),
178
178
  ] = None