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.
- {tai_sql-0.6.26 → tai_sql-0.6.28}/PKG-INFO +1 -1
- {tai_sql-0.6.26 → tai_sql-0.6.28}/pyproject.toml +1 -1
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_generate/funcs.py +1 -1
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/domain/dtos.py.jinja2 +3 -1
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/domain/model.py.jinja2 +2 -2
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/utils/encoders.py.jinja2 +14 -2
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/calculated.py +53 -24
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/encoders.py +10 -1
- {tai_sql-0.6.26 → tai_sql-0.6.28}/LICENSE +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/README.md +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_backup/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_backup/main.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_deploy/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_deploy/config.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_deploy/local.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_deploy/main.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_deploy/workflow.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_feed/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_feed/main.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_generate/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_generate/main.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_info/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_info/main.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_info/status.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_init/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_init/main.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_init/model.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_install/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_install/main.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_ping/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_ping/main.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_restore/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_restore/main.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_roles/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_roles/main.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/model.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/new.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/schemas/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/schemas/auth.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/schemas/base.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/schemas/chatbot.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/schemas/default.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/cmd_schema/set_default.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/prompts.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/connectivity.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/create.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/github/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/github/auth.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/github/client.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/commands/utils/github/models.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/main.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/backup.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/ddl.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/drift.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/feed.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/keycloak.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/cli/services/safety.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/core/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/core/funcs.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/core/provider.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/drivers/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/drivers/base.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/drivers/mysql.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/drivers/postgresql.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/drivers/sqlserver.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/base.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/diagram/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/base.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/domain/__init__.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/domain/dao.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/facade.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/aggregation.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/dataframe.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/filters.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/hierarchy.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/read.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/triggers.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/upsert.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/vector.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/write.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/session.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/__init__.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/aggregation.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/context.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/utils/__init__.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/utils/funcs.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/utils/hierarchy.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/shared/utils/rls.py.jinja2 +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/__init__.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/annotations.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/base.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/columns.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/descriptors.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/enumerations.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/relations.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/table.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/triggers.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/types.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/orm/view.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/project.py +0 -0
- {tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/schema.py +0 -0
|
@@ -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.
|
|
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()
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/domain/dtos.py.jinja2
RENAMED
|
@@ -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
|
|
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()
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/domain/model.py.jinja2
RENAMED
|
@@ -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
|
-
|
|
226
|
+
{% for line in calc_col.body_lines %}
|
|
227
227
|
{{ line }}
|
|
228
|
-
|
|
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__(
|
|
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.
|
|
143
|
-
to ``self._<name> = <expr>`` so the body can be rendered
|
|
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 (
|
|
168
|
+
List of source lines (with proper relative indentation).
|
|
148
169
|
"""
|
|
149
|
-
|
|
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
|
-
#
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
#
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/domain/dao.py.jinja2
RENAMED
|
File without changes
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/facade.py.jinja2
RENAMED
|
File without changes
|
|
File without changes
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/dataframe.jinja2
RENAMED
|
File without changes
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/filters.jinja2
RENAMED
|
File without changes
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/hierarchy.jinja2
RENAMED
|
File without changes
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/read.jinja2
RENAMED
|
File without changes
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/triggers.jinja2
RENAMED
|
File without changes
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/upsert.jinja2
RENAMED
|
File without changes
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/vector.jinja2
RENAMED
|
File without changes
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/macros/write.jinja2
RENAMED
|
File without changes
|
{tai_sql-0.6.26 → tai_sql-0.6.28}/tai_sql/generators/python_client/templates/session.py.jinja2
RENAMED
|
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
|