quantilica-cli 0.23.0__tar.gz → 0.24.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.
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/CHANGELOG.md +5 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/PKG-INFO +3 -3
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/pyproject.toml +3 -3
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/cli/catalog.py +17 -1
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_catalog_perfil.py +45 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/.githooks/pre-commit +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/.githooks/pre-push +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/.github/dependabot.yml +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/.github/workflows/public-hygiene.yml +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/.github/workflows/publish.yml +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/.github/workflows/test.yml +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/.gitignore +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/LICENSE +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/README.md +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/cli/__init__.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/cli/cli.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/cli/docs.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/cli/health.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/cli/lake.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/cli/manifests.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/cli/registry.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/cli/sdk.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/cli/sources.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/cli/ui.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/src/quantilica/py.typed +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/__init__.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/conftest.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/lake_build_fakes.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/lake_fixtures.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/renomes.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_catalog_cli.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_catalog_registro.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_catalog_sigla.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_cli_apelidos.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_docs_cli.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_health.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_lake_cli.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_manifests.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_package_hygiene.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_registry_cli.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_registry_v2.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_sdk.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_sdk_backfill.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_sdk_force_probe.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_sdk_mes_string.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_sdk_onda_a2.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_sdk_sync_exit.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_sources.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_sources_registro.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_sources_registro_publico.py +0 -0
- {quantilica_cli-0.23.0 → quantilica_cli-0.24.0}/tests/test_ui.py +0 -0
|
@@ -8,6 +8,11 @@ e este projeto adere ao [Semantic Versioning](https://semver.org/lang/pt-BR/).
|
|
|
8
8
|
## [Não lançado]
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
## [0.24.0] - 2026-11-15
|
|
12
|
+
### Alterado
|
|
13
|
+
- Piso de `quantilica-core` sobe para `>=0.24.0` (granularidades semestral, trimestral e diária do perfil de colunas).
|
|
14
|
+
- `quantilica catalog sync --dry-run`: o resumo do perfil conta os períodos na unidade da granularidade (`8 trimestres`, `4 semestres`, `31 dias`, `1 mês`), em vez de só `meses` ou `anos`. Os perfis semestrais, trimestrais e diários dependem da versão do `quantilica-core` com essas granularidades (ainda sem release; o piso de versão não mudou).
|
|
15
|
+
|
|
11
16
|
## [0.23.0] - 2026-11-15
|
|
12
17
|
### Adicionado
|
|
13
18
|
- `quantilica catalog sync` envia o perfil de colunas de cada dataset do lake na chave `perfis` do payload (`{"dataset_id", "perfil", "perfil_sha256"}`): por período, o total de linhas e os nulos de cada coluna, lidos dos rodapés Parquet por `quantilica.core.lake_profile.profile_from_lake`. O documento segue sem alteração, com o hash do core; só a coluna cujo nome o portal recusa sai do perfil (e do catálogo), com o hash recalculado. O perfil de um dataset nunca é partido entre lotes e viaja com as colunas dele. As colunas enviadas passam a ser a união das do perfil com as do primeiro Parquet, com o `dtype_arrow` do último período em que a coluna existe, porque o portal exige uma linha em `columns` para cada coluna do perfil. **O recurso exige o `quantilica-core` com `lake_profile`** (ainda sem release; o piso de versão não mudou): sem ele, o cli avisa e segue sem perfis. Dataset sem Parquet, sem partição `ano=` ou com perfil acima do limite do envio fica sem perfil, com aviso e o motivo.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: quantilica-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.24.0
|
|
4
4
|
Summary: Unified CLI for Quantilica open data fetchers
|
|
5
5
|
Author-email: "Komesu, D.K." <daniel@dkko.me>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -16,11 +16,11 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Classifier: Typing :: Typed
|
|
18
18
|
Requires-Python: >=3.12
|
|
19
|
-
Requires-Dist: quantilica-core>=0.
|
|
19
|
+
Requires-Dist: quantilica-core>=0.24.0
|
|
20
20
|
Requires-Dist: rich>=13.0.0
|
|
21
21
|
Requires-Dist: typer>=0.15.0
|
|
22
22
|
Provides-Extra: docs
|
|
23
|
-
Requires-Dist: quantilica-core[docs]>=0.
|
|
23
|
+
Requires-Dist: quantilica-core[docs]>=0.24.0; extra == 'docs'
|
|
24
24
|
Provides-Extra: lake
|
|
25
25
|
Requires-Dist: pyarrow>=15.0.0; extra == 'lake'
|
|
26
26
|
Requires-Dist: quantilica-analytics>=0.11.0; extra == 'lake'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "quantilica-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.24.0"
|
|
4
4
|
description = "Unified CLI for Quantilica open data fetchers"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{ name = "Komesu, D.K.", email = "daniel@dkko.me" }]
|
|
@@ -20,7 +20,7 @@ classifiers = [
|
|
|
20
20
|
"Programming Language :: Python :: 3.13",
|
|
21
21
|
]
|
|
22
22
|
dependencies = [
|
|
23
|
-
"quantilica-core>=0.
|
|
23
|
+
"quantilica-core>=0.24.0",
|
|
24
24
|
"rich>=13.0.0",
|
|
25
25
|
"typer>=0.15.0",
|
|
26
26
|
]
|
|
@@ -29,7 +29,7 @@ dependencies = [
|
|
|
29
29
|
# Motor de `quantilica lake build` e `quantilica lake audit`.
|
|
30
30
|
lake = ["quantilica-analytics>=0.11.0", "pyarrow>=15.0.0"]
|
|
31
31
|
# `quantilica docs`: verificação da documentação dos dados dos fetchers.
|
|
32
|
-
docs = ["quantilica-core[docs]>=0.
|
|
32
|
+
docs = ["quantilica-core[docs]>=0.24.0"]
|
|
33
33
|
|
|
34
34
|
[project.scripts]
|
|
35
35
|
quantilica = "quantilica.cli.cli:main"
|
|
@@ -824,6 +824,22 @@ def _avisa_perfis_recusados(res: Any) -> None:
|
|
|
824
824
|
)
|
|
825
825
|
|
|
826
826
|
|
|
827
|
+
# granularidade do perfil -> (singular, plural) do período no resumo.
|
|
828
|
+
_UNIDADES_DE_PERIODO = {
|
|
829
|
+
"anual": ("ano", "anos"),
|
|
830
|
+
"semestral": ("semestre", "semestres"),
|
|
831
|
+
"trimestral": ("trimestre", "trimestres"),
|
|
832
|
+
"mensal": ("mês", "meses"),
|
|
833
|
+
"diaria": ("dia", "dias"),
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
def _unidade_de_periodo(granularidade: str, n: int) -> str:
|
|
838
|
+
"""Unidade de contagem dos períodos de um perfil: ``8 trimestres``, ``1 mês``."""
|
|
839
|
+
singular, plural = _UNIDADES_DE_PERIODO.get(granularidade, ("período", "períodos"))
|
|
840
|
+
return singular if n == 1 else plural
|
|
841
|
+
|
|
842
|
+
|
|
827
843
|
def _tabela_de_perfis(perfis: list[dict[str, Any]]) -> Table:
|
|
828
844
|
"""Resumo por dataset do que seria enviado: períodos, colunas, eras e tamanho."""
|
|
829
845
|
mod = _lake_profile_module()
|
|
@@ -839,7 +855,7 @@ def _tabela_de_perfis(perfis: list[dict[str, Any]]) -> Table:
|
|
|
839
855
|
intervalo = (
|
|
840
856
|
f"{periodos[0]} a {periodos[-1]}" if len(periodos) > 1 else periodos[0]
|
|
841
857
|
)
|
|
842
|
-
unidade =
|
|
858
|
+
unidade = _unidade_de_periodo(doc["granularidade"], len(periodos))
|
|
843
859
|
eras = len(mod.derivar_eras(doc)) if mod is not None else 0
|
|
844
860
|
tabela.add_row(
|
|
845
861
|
item["dataset_id"],
|
|
@@ -363,6 +363,51 @@ def test_dry_run_resume_cada_perfil(tmp_path: Path) -> None:
|
|
|
363
363
|
assert "nulos" not in res.output
|
|
364
364
|
|
|
365
365
|
|
|
366
|
+
@pytest.mark.parametrize(
|
|
367
|
+
("granularidade", "n", "esperado"),
|
|
368
|
+
[
|
|
369
|
+
("anual", 1, "1 ano"),
|
|
370
|
+
("anual", 3, "3 anos"),
|
|
371
|
+
("semestral", 4, "4 semestres"),
|
|
372
|
+
("trimestral", 8, "8 trimestres"),
|
|
373
|
+
("trimestral", 1, "1 trimestre"),
|
|
374
|
+
("mensal", 2, "2 meses"),
|
|
375
|
+
("mensal", 1, "1 mês"),
|
|
376
|
+
("diaria", 31, "31 dias"),
|
|
377
|
+
("diaria", 1, "1 dia"),
|
|
378
|
+
("outra", 2, "2 períodos"),
|
|
379
|
+
],
|
|
380
|
+
)
|
|
381
|
+
def test_unidade_de_periodo_por_granularidade(
|
|
382
|
+
granularidade: str, n: int, esperado: str
|
|
383
|
+
) -> None:
|
|
384
|
+
unidade = catalog_mod._unidade_de_periodo(granularidade, n)
|
|
385
|
+
assert f"{n} {unidade}" == esperado
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
def test_dry_run_resume_perfil_trimestral(tmp_path: Path) -> None:
|
|
389
|
+
from quantilica.core import lake_profile
|
|
390
|
+
|
|
391
|
+
if not hasattr(lake_profile, "GRANULARIDADES"):
|
|
392
|
+
pytest.skip("quantilica-core sem as granularidades novas do perfil")
|
|
393
|
+
base = tmp_path / "cvm" / "divida"
|
|
394
|
+
base.mkdir(parents=True)
|
|
395
|
+
(base / "_dataset.json").write_text(
|
|
396
|
+
json.dumps({"source_id": "cvm", "dataset_id": "divida", "alias": "divida"}),
|
|
397
|
+
encoding="utf-8",
|
|
398
|
+
)
|
|
399
|
+
for ano, tri in [(2023, 3), (2023, 4), (2024, 1)]:
|
|
400
|
+
pasta = base / f"ano={ano}" / f"trimestre={tri}"
|
|
401
|
+
pasta.mkdir(parents=True)
|
|
402
|
+
pq.write_table(pa.table({"valor": [1.0, None]}), pasta / "part-0.parquet")
|
|
403
|
+
res = runner.invoke(
|
|
404
|
+
app, ["catalog", "sync", "--lake-dir", str(tmp_path), "--dry-run"]
|
|
405
|
+
)
|
|
406
|
+
assert res.exit_code == 0, res.output
|
|
407
|
+
saida = _junta(res.output)
|
|
408
|
+
assert "2023-T3 a 2024-T1 (3 trimestres)" in saida
|
|
409
|
+
|
|
410
|
+
|
|
366
411
|
def test_core_sem_lake_profile_avisa_e_segue_sem_perfis(
|
|
367
412
|
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
368
413
|
) -> None:
|
|
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
|