tai-sql 0.6.26__tar.gz → 0.6.28__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 (108) hide show
  1. {tai_sql-0.6.26 → tai_sql-0.6.28}/PKG-INFO +1 -1
  2. {tai_sql-0.6.26 → tai_sql-0.6.28}/pyproject.toml +1 -1
  3. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_generate/funcs.py +1 -1
  4. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/domain/dtos.py.jinja2 +3 -1
  5. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/domain/model.py.jinja2 +2 -2
  6. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/utils/encoders.py.jinja2 +14 -2
  7. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/calculated.py +53 -24
  8. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/encoders.py +10 -1
  9. {tai_sql-0.6.26 → tai_sql-0.6.28}/LICENSE +0 -0
  10. {tai_sql-0.6.26 → tai_sql-0.6.28}/README.md +0 -0
  11. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/__init__.py +0 -0
  12. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/__init__.py +0 -0
  13. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_backup/__init__.py +0 -0
  14. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_backup/main.py +0 -0
  15. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_deploy/__init__.py +0 -0
  16. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_deploy/config.py +0 -0
  17. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_deploy/local.py +0 -0
  18. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_deploy/main.py +0 -0
  19. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_deploy/workflow.py +0 -0
  20. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_feed/__init__.py +0 -0
  21. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_feed/main.py +0 -0
  22. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_generate/__init__.py +0 -0
  23. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_generate/main.py +0 -0
  24. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_info/__init__.py +0 -0
  25. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_info/main.py +0 -0
  26. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_info/status.py +0 -0
  27. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_init/__init__.py +0 -0
  28. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_init/main.py +0 -0
  29. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_init/model.py +0 -0
  30. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_install/__init__.py +0 -0
  31. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_install/main.py +0 -0
  32. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_ping/__init__.py +0 -0
  33. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_ping/main.py +0 -0
  34. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_restore/__init__.py +0 -0
  35. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_restore/main.py +0 -0
  36. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_roles/__init__.py +0 -0
  37. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_roles/main.py +0 -0
  38. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/__init__.py +0 -0
  39. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/model.py +0 -0
  40. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/new.py +0 -0
  41. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/schemas/__init__.py +0 -0
  42. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/schemas/auth.py +0 -0
  43. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/schemas/base.py +0 -0
  44. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/schemas/chatbot.py +0 -0
  45. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/schemas/default.py +0 -0
  46. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/set_default.py +0 -0
  47. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/prompts.py +0 -0
  48. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/__init__.py +0 -0
  49. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/connectivity.py +0 -0
  50. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/create.py +0 -0
  51. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/github/__init__.py +0 -0
  52. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/github/auth.py +0 -0
  53. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/github/client.py +0 -0
  54. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/github/models.py +0 -0
  55. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/main.py +0 -0
  56. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/__init__.py +0 -0
  57. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/backup.py +0 -0
  58. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/ddl.py +0 -0
  59. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/drift.py +0 -0
  60. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/feed.py +0 -0
  61. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/keycloak.py +0 -0
  62. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/safety.py +0 -0
  63. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/core/__init__.py +0 -0
  64. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/core/funcs.py +0 -0
  65. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/core/provider.py +0 -0
  66. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/drivers/__init__.py +0 -0
  67. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/drivers/base.py +0 -0
  68. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/drivers/mysql.py +0 -0
  69. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/drivers/postgresql.py +0 -0
  70. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/drivers/sqlserver.py +0 -0
  71. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/__init__.py +0 -0
  72. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/base.py +0 -0
  73. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/diagram/__init__.py +0 -0
  74. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/__init__.py +0 -0
  75. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/base.py.jinja2 +0 -0
  76. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/domain/__init__.py.jinja2 +0 -0
  77. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/domain/dao.py.jinja2 +0 -0
  78. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/facade.py.jinja2 +0 -0
  79. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/aggregation.jinja2 +0 -0
  80. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/dataframe.jinja2 +0 -0
  81. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/filters.jinja2 +0 -0
  82. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/hierarchy.jinja2 +0 -0
  83. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/read.jinja2 +0 -0
  84. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/triggers.jinja2 +0 -0
  85. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/upsert.jinja2 +0 -0
  86. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/vector.jinja2 +0 -0
  87. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/write.jinja2 +0 -0
  88. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/session.py.jinja2 +0 -0
  89. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/__init__.py.jinja2 +0 -0
  90. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/aggregation.py.jinja2 +0 -0
  91. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/context.py.jinja2 +0 -0
  92. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/utils/__init__.py.jinja2 +0 -0
  93. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/utils/funcs.py.jinja2 +0 -0
  94. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/utils/hierarchy.py.jinja2 +0 -0
  95. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/utils/rls.py.jinja2 +0 -0
  96. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/__init__.py +0 -0
  97. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/annotations.py +0 -0
  98. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/base.py +0 -0
  99. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/columns.py +0 -0
  100. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/descriptors.py +0 -0
  101. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/enumerations.py +0 -0
  102. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/relations.py +0 -0
  103. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/table.py +0 -0
  104. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/triggers.py +0 -0
  105. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/types.py +0 -0
  106. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/view.py +0 -0
  107. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/project.py +0 -0
  108. {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/schema.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tai-sql
3
- Version: 0.6.26
3
+ Version: 0.6.28
4
4
  Summary: SQL database management and code generation tool
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tai-sql"
3
- version = "0.6.26"
3
+ version = "0.6.28"
4
4
  description = "SQL database management and code generation tool"
5
5
  license = {text = "MIT"}
6
6
  authors = [
@@ -15,7 +15,7 @@ def run_generate(schema_name: str=None):
15
15
  for generator in pm.db.generators:
16
16
  try:
17
17
  generator_name = generator.__class__.__name__
18
- click.echo(f" • {click.style(generator_name, bold=True)} → {generator.config.output_dir}")
18
+ click.echo(f" • {click.style(generator_name, bold=True)} → {' | '.join(generator.config.output_dirs)}")
19
19
 
20
20
  # El generador se encargará de descubrir los modelos internamente
21
21
  result = generator.generate()
@@ -596,7 +596,9 @@ class {{ model.name }}DataFrameValidator:
596
596
  for record in records_data:
597
597
  cleaned_record = {}
598
598
  for key, value in record.items():
599
- if pd.isna(value):
599
+ if isinstance(value, list):
600
+ cleaned_record[key] = value
601
+ elif pd.isna(value):
600
602
  cleaned_record[key] = None
601
603
  elif hasattr(value, 'item'):
602
604
  cleaned_record[key] = value.item()
@@ -223,9 +223,9 @@ class {{ model.name }}(Base):
223
223
 
224
224
  def _recompute_{{ calc_col.name }}(self):
225
225
  """Recompute calculated column ``{{ calc_col.name }}``."""
226
- {% for line in calc_col.body_lines %}
226
+ {% for line in calc_col.body_lines %}
227
227
  {{ line }}
228
- {% endfor %}
228
+ {% endfor %}
229
229
  {% endfor %}
230
230
 
231
231
  {# ── 7. Relationships ────────────────────────────────────────────────── #}
@@ -255,10 +255,18 @@ class GoogleEncoder(BaseEncoder):
255
255
  Env: GOOGLE_API_KEY
256
256
  """
257
257
 
258
- def __init__(self, model: str = 'gemini-embedding-2-preview', dimensions: int | None = None):
258
+ def __init__(
259
+ self,
260
+ model: str = 'gemini-embedding-2-preview',
261
+ dimensions: int | None = None,
262
+ location: str | None = None,
263
+ project_id: str | None = None,
264
+ ):
259
265
  self._model_name = model
260
266
  self._client = None
261
267
  self._dimensions: int | None = dimensions
268
+ self._location = location
269
+ self._project_id = project_id
262
270
 
263
271
  @property
264
272
  def dimensions(self) -> int:
@@ -280,6 +288,10 @@ class GoogleEncoder(BaseEncoder):
280
288
  kwargs = {"model": self._model_name}
281
289
  if self._dimensions is not None:
282
290
  kwargs["output_dimensionality"] = self._dimensions
291
+ if self._location:
292
+ kwargs["location"] = self._location
293
+ if self._project_id:
294
+ kwargs["project_id"] = self._project_id
283
295
  self._client = GoogleGenerativeAIEmbeddings(**kwargs)
284
296
  logger.info(f"[encoder] Google '{self._model_name}' ready ({self._dimensions} dims)")
285
297
 
@@ -323,7 +335,7 @@ class GoogleEncoder(BaseEncoder):
323
335
  {% elif col.encoder_config.get('class') == 'AzureOpenAIEncoder' %}
324
336
  {{ model.tablename }}_{{ col.name }}_encoder = AzureOpenAIEncoder(model='{{ col.encoder_config.model }}', dimensions={{ col.dimensions }}{{ ', azure_endpoint="' + col.encoder_config.azure_endpoint + '"' if col.encoder_config.get('azure_endpoint') else '' }}{{ ', api_version="' + col.encoder_config.api_version + '"' if col.encoder_config.get('api_version') else '' }})
325
337
  {% elif col.encoder_config.get('class') == 'GoogleEncoder' %}
326
- {{ model.tablename }}_{{ col.name }}_encoder = GoogleEncoder(model='{{ col.encoder_config.model }}', dimensions={{ col.dimensions }})
338
+ {{ model.tablename }}_{{ col.name }}_encoder = GoogleEncoder(model='{{ col.encoder_config.model }}', dimensions={{ col.dimensions }}{{ ', location="' + col.encoder_config.location + '"' if col.encoder_config.get('location') else '' }}{{ ', project_id="' + col.encoder_config.project_id + '"' if col.encoder_config.get('project_id') else '' }})
327
339
  {% endif %}
328
340
  {% endif %}
329
341
  {% endfor %}
@@ -66,6 +66,27 @@ class _ExternalNameExtractor(ast.NodeVisitor):
66
66
  self.generic_visit(node)
67
67
 
68
68
 
69
+ class _ReturnToAssignmentTransformer(ast.NodeTransformer):
70
+ """AST transformer that converts all ``return`` statements to assignments."""
71
+
72
+ def __init__(self, column_name: str) -> None:
73
+ self.column_name = column_name
74
+
75
+ def visit_Return(self, node: ast.Return) -> ast.Assign:
76
+ """Replace ``return expr`` with ``self._<name> = expr``."""
77
+ assign = ast.Assign(
78
+ targets=[ast.Attribute(
79
+ value=ast.Name(id='self', ctx=ast.Load()),
80
+ attr=f'_{self.column_name}',
81
+ ctx=ast.Store(),
82
+ )],
83
+ value=node.value if node.value is not None else ast.Constant(value=None),
84
+ lineno=node.lineno,
85
+ col_offset=node.col_offset,
86
+ )
87
+ return ast.copy_location(assign, node)
88
+
89
+
69
90
  class CalculatedColumn(AutoRegisterDescriptor):
70
91
  """
71
92
  Descriptor for calculated columns that auto-register on their owner Table.
@@ -139,14 +160,18 @@ class CalculatedColumn(AutoRegisterDescriptor):
139
160
  """
140
161
  Return the full function body as a list of Python source lines.
141
162
 
142
- The docstring is stripped. The last ``return`` statement is converted
143
- to ``self._<name> = <expr>`` so the body can be rendered directly
144
- inside ``_recompute_<name>(self)``.
163
+ The docstring is stripped. All ``return`` statements (including nested ones)
164
+ are converted to ``self._<name> = <expr>`` so the body can be rendered
165
+ directly inside ``_recompute_<name>(self)``.
145
166
 
146
167
  Returns:
147
- List of source lines (without leading indentation).
168
+ List of source lines (with proper relative indentation).
148
169
  """
149
- body = list(self.ast_tree.body)
170
+ import copy
171
+
172
+ # Make a deep copy to avoid mutating the original AST
173
+ body = [copy.deepcopy(stmt) for stmt in self.ast_tree.body]
174
+
150
175
  # Skip docstring
151
176
  if (body and isinstance(body[0], ast.Expr)
152
177
  and isinstance(getattr(body[0], 'value', None), ast.Constant)
@@ -156,26 +181,30 @@ class CalculatedColumn(AutoRegisterDescriptor):
156
181
  if not body:
157
182
  return [f'self._{self.name} = None']
158
183
 
159
- # Convert the last return statement to an assignment
160
- last = body[-1]
161
- if isinstance(last, ast.Return) and last.value is not None:
162
- assign = ast.Assign(
163
- targets=[ast.Attribute(
164
- value=ast.Name(id='self', ctx=ast.Load()),
165
- attr=f'_{self.name}',
166
- ctx=ast.Store(),
167
- )],
168
- value=last.value,
169
- lineno=last.lineno,
170
- )
171
- body[-1] = assign
172
- elif isinstance(last, ast.Return):
173
- # return with no value assign None
174
- body[-1] = ast.parse(f'self._{self.name} = None').body[0]
175
-
176
- module = ast.Module(body=body, type_ignores=[])
184
+ # Transform all return statements to assignments recursively
185
+ transformer = _ReturnToAssignmentTransformer(self.name)
186
+ transformed_body = [transformer.visit(stmt) for stmt in body]
187
+
188
+ # Optimize pattern: if <cond>: assignment + unconditional assignment → if/else
189
+ # Common pattern from: if x: return val; return None
190
+ if (len(transformed_body) >= 2
191
+ and isinstance(transformed_body[-2], ast.If)
192
+ and isinstance(transformed_body[-1], ast.Assign)
193
+ and not transformed_body[-2].orelse): # No else clause yet
194
+
195
+ if_stmt = transformed_body[-2]
196
+ final_assign = transformed_body[-1]
197
+
198
+ # Move final assignment into else clause
199
+ if_stmt.orelse = [final_assign]
200
+ transformed_body = transformed_body[:-1]
201
+
202
+ module = ast.Module(body=transformed_body, type_ignores=[])
177
203
  ast.fix_missing_locations(module)
178
- return [ast.unparse(stmt) for stmt in module.body]
204
+
205
+ # Unparse the entire body and split into lines
206
+ code = ast.unparse(module)
207
+ return code.splitlines()
179
208
 
180
209
  # ── SQL expression generation ────────────────────────────────────────
181
210
 
@@ -277,9 +277,13 @@ class GoogleEncoder(BaseEncoder):
277
277
  self,
278
278
  model: GoogleModelTypes = 'gemini-embedding-2-preview',
279
279
  dimensions: Optional[int] = None,
280
+ location: Optional[str] = None,
281
+ project_id: Optional[str] = None,
280
282
  ):
281
283
  self._model_name = model
282
284
  self._dimensions = dimensions or self.KNOWN_MODELS.get(model)
285
+ self._location = location
286
+ self._project_id = project_id
283
287
 
284
288
  @property
285
289
  def dimensions(self) -> int:
@@ -290,9 +294,14 @@ class GoogleEncoder(BaseEncoder):
290
294
  )
291
295
 
292
296
  def get_config(self) -> dict:
293
- return {
297
+ config = {
294
298
  'class': 'GoogleEncoder',
295
299
  'model': self._model_name,
296
300
  'dimensions': self._dimensions,
297
301
  }
302
+ if self._location:
303
+ config['location'] = self._location
304
+ if self._project_id:
305
+ config['project_id'] = self._project_id
306
+ return config
298
307
 
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