tigrbl_engine_xlsx 0.1.1.dev3__tar.gz → 0.1.1.dev5__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.
@@ -30,9 +30,13 @@ pkgs/standards/peagen/.pymon
30
30
  gateway.db
31
31
  kms.db
32
32
  *.asc
33
+ *.kid
33
34
  *.so
34
35
  *.db
35
36
  target/
36
37
  !.gitkeep # keep the empty dir in repo
37
38
  pkgs/experimental/swarmakit/libs/svelte/.vscode/extensions.json
38
39
  node_modules/
40
+ *.zip
41
+ .pymon
42
+ /.tmp_pydeps
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tigrbl_engine_xlsx
3
- Version: 0.1.1.dev3
3
+ Version: 0.1.1.dev5
4
4
  Summary: XLSX engine plugin for tigrbl where each workbook is a database and each sheet is a table.
5
5
  Project-URL: Homepage, https://github.com/swarmauri/swarmauri-sdk
6
6
  Author-email: Jacob Stewart <jacob@swarmauri.com>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "tigrbl_engine_xlsx"
7
- version = "0.1.1.dev3"
7
+ version = "0.1.1.dev5"
8
8
  description = "XLSX engine plugin for tigrbl where each workbook is a database and each sheet is a table."
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -344,14 +344,20 @@ class XlsxSession(TigrblSessionBase):
344
344
  return obj
345
345
 
346
346
  def _scan_model(self, model: type) -> List[Any]:
347
- out = [self._inflate(model, row) for row in self._rows_for(model)]
348
347
  pk = _single_pk_name(model)
349
- by_id = {getattr(obj, pk): obj for obj in out}
348
+ by_id: Dict[Any, Any] = {}
349
+ for row in self._rows_for(model):
350
+ ident = row.get(pk)
351
+ if ident is None:
352
+ continue
353
+ tracked = self._tracked.get((model, ident))
354
+ if tracked is not None:
355
+ by_id[ident] = tracked
356
+ else:
357
+ by_id[ident] = self._inflate_tracked(model, ident, row)
350
358
  for (known_model, ident), row in self._puts.items():
351
359
  if known_model is model:
352
360
  by_id[ident] = self._inflate_tracked(model, ident, row)
353
- for ident, obj in list(by_id.items()):
354
- self._tracked[(model, ident)] = obj
355
361
  for known_model, ident in self._dels:
356
362
  if known_model is model:
357
363
  by_id.pop(ident, None)
@@ -6,10 +6,11 @@ from openpyxl import Workbook
6
6
  import pytest
7
7
 
8
8
  from tigrbl import TigrblApp
9
- from tigrbl.bindings import rpc_call
9
+ from tigrbl import rpc_call
10
10
  from tigrbl.engine import EngineSpec
11
11
  from tigrbl.orm.mixins import GUIDPk
12
- from tigrbl.specs import F, IO, S, acol
12
+ from tigrbl.specs import F, IO, S
13
+ from tigrbl.shortcuts import acol
13
14
  from tigrbl.table import Table
14
15
  from tigrbl.types import Mapped, String
15
16