fdl-cli 0.14.0__tar.gz → 0.15.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. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/CHANGELOG.md +22 -0
  2. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/PKG-INFO +1 -1
  3. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/reference/cli.md +1 -1
  4. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/spec/versions.md +1 -1
  5. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/reference/cli.md +1 -1
  6. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/spec/versions.md +1 -1
  7. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/pyproject.toml +1 -1
  8. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/src/fdl/cli.py +2 -2
  9. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/src/fdl/dataset.py +23 -0
  10. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/src/fdl/stores.py +15 -1
  11. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/tests/test_dataset.py +13 -1
  12. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/tests/test_http.py +15 -0
  13. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/uv.lock +1 -1
  14. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/.github/workflows/docs.yml +0 -0
  15. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/.github/workflows/publish.yml +0 -0
  16. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/.github/workflows/release.yml +0 -0
  17. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/.gitignore +0 -0
  18. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/.node-version +0 -0
  19. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/.python-version +0 -0
  20. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/CLAUDE.md +0 -0
  21. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/CONTRIBUTING.md +0 -0
  22. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/LICENSE +0 -0
  23. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/README.md +0 -0
  24. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/blume.config.ts +0 -0
  25. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/concepts/meta.ts +0 -0
  26. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/concepts/repositories.md +0 -0
  27. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/concepts/versions-and-refs.md +0 -0
  28. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/concepts/working-catalogs.md +0 -0
  29. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/getting-started.md +0 -0
  30. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/guides/building-a-host.md +0 -0
  31. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/guides/meta.ts +0 -0
  32. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/guides/mirrors.md +0 -0
  33. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/guides/public-and-private.md +0 -0
  34. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/guides/serving-over-http.md +0 -0
  35. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/guides/stores.md +0 -0
  36. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/index.md +0 -0
  37. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/internals/ducklake-formats.md +0 -0
  38. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/internals/inside-a-repository.md +0 -0
  39. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/internals/meta.ts +0 -0
  40. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/concepts/meta.ts +0 -0
  41. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/concepts/repositories.md +0 -0
  42. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/concepts/versions-and-refs.md +0 -0
  43. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/concepts/working-catalogs.md +0 -0
  44. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/getting-started.md +0 -0
  45. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/guides/building-a-host.md +0 -0
  46. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/guides/meta.ts +0 -0
  47. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/guides/mirrors.md +0 -0
  48. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/guides/public-and-private.md +0 -0
  49. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/guides/serving-over-http.md +0 -0
  50. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/guides/stores.md +0 -0
  51. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/index.md +0 -0
  52. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/internals/ducklake-formats.md +0 -0
  53. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/internals/inside-a-repository.md +0 -0
  54. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/internals/meta.ts +0 -0
  55. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/reference/meta.ts +0 -0
  56. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/reference/python.md +0 -0
  57. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/spec/data-files.md +0 -0
  58. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/spec/http.md +0 -0
  59. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/spec/index.md +0 -0
  60. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/spec/layout.md +0 -0
  61. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/spec/meta.ts +0 -0
  62. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/spec/reading.md +0 -0
  63. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/spec/refs.md +0 -0
  64. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/ja/spec/writing.md +0 -0
  65. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/reference/meta.ts +0 -0
  66. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/reference/python.md +0 -0
  67. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/spec/data-files.md +0 -0
  68. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/spec/http.md +0 -0
  69. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/spec/index.md +0 -0
  70. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/spec/layout.md +0 -0
  71. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/spec/meta.ts +0 -0
  72. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/spec/reading.md +0 -0
  73. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/spec/refs.md +0 -0
  74. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/docs/spec/writing.md +0 -0
  75. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/package-lock.json +0 -0
  76. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/package.json +0 -0
  77. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/public/CNAME +0 -0
  78. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/src/fdl/__init__.py +0 -0
  79. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/src/fdl/catalog.py +0 -0
  80. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/src/fdl/layout.py +0 -0
  81. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/src/fdl/py.typed +0 -0
  82. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/src/fdl/refs.py +0 -0
  83. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/src/fdl/repo.py +0 -0
  84. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/src/fdl/store.py +0 -0
  85. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/src/fdl/version.py +0 -0
  86. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/tests/http_repo.py +0 -0
  87. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/tests/test_cli.py +0 -0
  88. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/tests/test_repo.py +0 -0
  89. {fdl_cli-0.14.0 → fdl_cli-0.15.0}/tests/test_stores.py +0 -0
@@ -1,6 +1,28 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v0.15.0 (2026-11-01)
5
+
6
+ ### Features
7
+
8
+ - Read tables from *.table.yml files beside the description
9
+ ([`3ffa77a`](https://github.com/queria-io/fdl/commit/3ffa77a620ec818ce59ea5f957c7b341bae72f8d))
10
+
11
+ A table can be described in its own file next to what builds it. fdl commit adds the tables in
12
+ *.table.yml / *.table.json below the description's folder, skipping hidden folders.
13
+
14
+
15
+ ## v0.14.1 (2026-11-01)
16
+
17
+ ### Bug Fixes
18
+
19
+ - Name fdl in the User-Agent of HTTP requests
20
+ ([`f1fa818`](https://github.com/queria-io/fdl/commit/f1fa818c02ff66ef50a6277d258719dc446bb129))
21
+
22
+ Cloudflare's browser integrity check refuses the default Python-urllib agent with 403 (error code
23
+ 1010), so checkout from such a host failed.
24
+
25
+
4
26
  ## v0.14.0 (2026-11-01)
5
27
 
6
28
  ### Documentation
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: fdl-cli
3
- Version: 0.14.0
3
+ Version: 0.15.0
4
4
  Summary: Versions of a DuckLake catalog on object storage, kept the way Git keeps commits
5
5
  Project-URL: Homepage, https://fdl.flo8s.com/
6
6
  Project-URL: Documentation, https://fdl.flo8s.com/
@@ -41,7 +41,7 @@ fdl commit <working.sqlite> -m "What changed" --author alice [--dataset dataset.
41
41
 
42
42
  作業カタログを、チェックアウトしたバージョンを親とする新しいバージョンに固め、アップロードし、条件付きでブランチを動かします。ブランチ、新しいバージョン ID、`seq` を表示します。
43
43
 
44
- バージョンはそれぞれ `dataset.json`([バージョン](/ja/spec/versions#datasetjson)を参照)で説明します。`--dataset` で指定したファイルか、なければいまのディレクトリの `dataset.json` か `dataset.yml` から読みます。コマンドはそれをカタログと照らし合わせ、列の型、行数、カタログのコメントを書き足します。
44
+ バージョンはそれぞれ `dataset.json`([バージョン](/ja/spec/versions#datasetjson)を参照)で説明します。`--dataset` で指定したファイルか、なければいまのディレクトリの `dataset.json` か `dataset.yml` から読みます。そのフォルダより下にある `*.table.yml`(または `*.table.json`)のテーブルの説明も合わせて読みます。隠しフォルダの中は読みません。コマンドはそれをカタログと照らし合わせ、列の型、行数、カタログのコメントを書き足します。
45
45
 
46
46
  次のときは断られます。
47
47
 
@@ -142,7 +142,7 @@ FDL 0.1 では、書き手が書く親は多くても 1 つです。`parents`
142
142
  ```
143
143
 
144
144
  - 必須なのは `name` と `title` だけで、ほかは省いてよい
145
- - 書き手は説明を YAML(`dataset.yml`)で持ってもよい。バージョンには常に JSON で入る
145
+ - 書き手は説明を YAML(`dataset.yml`)で持ってもよく、テーブルごとに別のファイル(`<name>.table.yml`、`tables` の 1 項目)に分けてもよい。バージョンには常に説明全体が 1 つの JSON で入る
146
146
  - `licenses` の各要素は SPDX の識別子か、`id` に書き手が足したいもの(`spdx`・`url`・`title`)を添えたオブジェクト
147
147
  - `tables` には、カタログの最後のスナップショットにある表をすべて並べる。書き手が説明しなかった表は、書き手のツールがカタログから分かることで足す。カタログに無い表や列を説明していたら断る
148
148
  - カタログから取るもの: 表ごとの `rows`、列ごとの `type`(DuckLake の型名)と `nullable`。書き手が `description` を書かなかったところには、カタログのコメント(`COMMENT ON`)を使う
@@ -41,7 +41,7 @@ fdl commit <working.sqlite> -m "What changed" --author alice [--dataset dataset.
41
41
 
42
42
  Freezes the working catalog into a new version whose parent is the version it was checked out at, uploads it, and moves the branch on condition. It prints the branch, the new version ID and its `seq`.
43
43
 
44
- Every version is described by a `dataset.json` (see [Versions](/spec/versions#datasetjson)), read from `--dataset` or else from `dataset.json` or `dataset.yml` in the current directory. The command checks it against the catalog and fills in the column types, row counts and catalog comments.
44
+ Every version is described by a `dataset.json` (see [Versions](/spec/versions#datasetjson)), read from `--dataset` or else from `dataset.json` or `dataset.yml` in the current directory. Tables described in `*.table.yml` (or `*.table.json`) files below that folder are added to it; hidden folders are skipped. The command checks it against the catalog and fills in the column types, row counts and catalog comments.
45
45
 
46
46
  Refused when:
47
47
 
@@ -142,7 +142,7 @@ The writer describes; the writer's tool checks the description against the froze
142
142
  ```
143
143
 
144
144
  - `name` and `title` are required. Everything else may be left out
145
- - A writer may keep its description as YAML (`dataset.yml`); the version always holds it as JSON
145
+ - A writer may keep its description as YAML (`dataset.yml`), and may keep each table in its own file (`<name>.table.yml`, one entry of `tables`). The version always holds the whole description as one JSON
146
146
  - Each of `licenses` is an SPDX identifier, or an object with `id` and what the writer wants to add (`spdx`, `url`, `title`)
147
147
  - `tables` lists every table of the catalog's last snapshot. The writer's tool adds the tables the writer did not describe, with what the catalog knows of them, and refuses a described table or column the catalog lacks
148
148
  - From the catalog: each table's `rows`, and each field's `type` (DuckLake's type name) and `nullable`. Comments in the catalog (`COMMENT ON`) are used where the writer gave no `description`
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fdl-cli"
3
- version = "0.14.0"
3
+ version = "0.15.0"
4
4
  description = "Versions of a DuckLake catalog on object storage, kept the way Git keeps commits"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -99,7 +99,7 @@ def commit(
99
99
  describe: Path | None = typer.Option(
100
100
  None,
101
101
  "--dataset",
102
- help="The description of what the version holds (default: dataset.json or dataset.yml here)",
102
+ help="The description of what the version holds (default: dataset.json or dataset.yml here), with any *.table.yml below it",
103
103
  ),
104
104
  ) -> None:
105
105
  """Freeze the working catalog into a version and push it to its branch."""
@@ -107,7 +107,7 @@ def commit(
107
107
  store = open_store(state["remote"])
108
108
  out = Path(tempfile.mkdtemp(prefix="fdl-"))
109
109
  try:
110
- declared = dataset.read(describe or dataset.find())
110
+ declared = dataset.gather(describe or dataset.find())
111
111
  parent = repo.read_version(store, state["base"]) if state["base"] else None
112
112
  version = repo.commit(
113
113
  working,
@@ -65,6 +65,29 @@ def read(path: Path) -> dict[str, Any]:
65
65
  return declared
66
66
 
67
67
 
68
+ #: Tables may each be described in their own file, next to what builds them.
69
+ TABLE_FILES = ("*.table.json", "*.table.yml", "*.table.yaml")
70
+
71
+
72
+ def gather(path: Path) -> dict[str, Any]:
73
+ """The description in ``path`` with the tables described in table files.
74
+
75
+ A table file (``<name>.table.yml``) holds one entry of ``tables``. They are
76
+ looked for below the description's folder, skipping hidden folders.
77
+ """
78
+ declared = read(path)
79
+ root = Path(path).resolve().parent
80
+ files = sorted(
81
+ found
82
+ for pattern in TABLE_FILES
83
+ for found in root.rglob(pattern)
84
+ if not any(part.startswith(".") for part in found.relative_to(root).parts[:-1])
85
+ )
86
+ if not files:
87
+ return declared
88
+ return {**declared, "tables": [*declared.get("tables", []), *map(read, files)]}
89
+
90
+
68
91
  def describe(declared: dict[str, Any], frozen: Path) -> dict[str, Any]:
69
92
  """The `dataset.json` of a version: ``declared`` checked against the catalog.
70
93
 
@@ -8,6 +8,7 @@ missing, 412 for a failed condition), which is all `fdl.store` looks at.
8
8
  from __future__ import annotations
9
9
 
10
10
  import hashlib
11
+ import importlib.metadata
11
12
  import json
12
13
  import os
13
14
  import urllib.error
@@ -17,6 +18,17 @@ from typing import Iterator, Sequence
17
18
  from urllib.parse import quote, urlencode, urlparse
18
19
 
19
20
 
21
+ def _version() -> str:
22
+ try:
23
+ return importlib.metadata.version("fdl-cli")
24
+ except importlib.metadata.PackageNotFoundError:
25
+ return "dev"
26
+
27
+
28
+ #: Sent with every request. Some hosts refuse the default ``Python-urllib/x.y``.
29
+ USER_AGENT = f"fdl/{_version()}"
30
+
31
+
20
32
  class StoreError(RuntimeError):
21
33
  def __init__(self, message: str, *, status: int | None = None) -> None:
22
34
  super().__init__(message)
@@ -215,7 +227,9 @@ class HttpStore:
215
227
  headers: dict[str, str] | None = None,
216
228
  ):
217
229
  url = self.root + quote(key) + ("?" + urlencode(query) if query else "")
218
- request = urllib.request.Request(url, data=data, method=method, headers=dict(headers or {}))
230
+ request = urllib.request.Request(
231
+ url, data=data, method=method, headers={"User-Agent": USER_AGENT, **(headers or {})}
232
+ )
219
233
  if self.token:
220
234
  request.add_header("Authorization", f"Bearer {self.token}")
221
235
  try:
@@ -7,7 +7,7 @@ from pathlib import Path
7
7
  import duckdb
8
8
  import pytest
9
9
 
10
- from fdl.dataset import DatasetError, describe
10
+ from fdl.dataset import DatasetError, describe, gather
11
11
 
12
12
 
13
13
  @pytest.fixture
@@ -68,3 +68,15 @@ def test_a_description_can_be_yaml(tmp_path: Path, frozen: Path) -> None:
68
68
  from fdl.dataset import to_json
69
69
 
70
70
  assert b'"issued": "2026-10-30"' in to_json(described)
71
+
72
+
73
+ def test_tables_can_be_described_in_their_own_files(tmp_path: Path, frozen: Path) -> None:
74
+ (tmp_path / "dataset.yml").write_text("name: towns\ntitle: Towns\n")
75
+ (tmp_path / "models").mkdir()
76
+ (tmp_path / "models" / "towns.table.yml").write_text(
77
+ "schema: main\nname: towns\ntitle: The towns\n"
78
+ )
79
+ (tmp_path / ".fdl").mkdir()
80
+ (tmp_path / ".fdl" / "stale.table.yml").write_text("schema: main\nname: gone\n")
81
+ (table,) = describe(gather(tmp_path / "dataset.yml"), frozen)["tables"]
82
+ assert table["title"] == "The towns"
@@ -3,6 +3,8 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import json
6
+ import urllib.error
7
+ import urllib.request
6
8
  from pathlib import Path
7
9
 
8
10
  import duckdb
@@ -108,3 +110,16 @@ def test_the_round_trip_over_http(served, tmp_path: Path) -> None:
108
110
  f"ATTACH 'ducklake:{frozen}' AS v (READ_ONLY, DATA_PATH '{repo.data_url(local)}', OVERRIDE_DATA_PATH true)"
109
111
  )
110
112
  assert con.execute("SELECT towns FROM v.main.roads").fetchone() == (1,)
113
+
114
+
115
+ def test_requests_name_fdl(monkeypatch) -> None:
116
+ sent = []
117
+
118
+ def urlopen(request):
119
+ sent.append(request)
120
+ raise urllib.error.URLError("offline")
121
+
122
+ monkeypatch.setattr(urllib.request, "urlopen", urlopen)
123
+ with pytest.raises(StoreError):
124
+ HttpStore("https://example.invalid/repo/").get("fdl.json")
125
+ assert sent[0].get_header("User-agent").startswith("fdl/")
@@ -360,7 +360,7 @@ wheels = [
360
360
 
361
361
  [[package]]
362
362
  name = "fdl-cli"
363
- version = "0.13.0"
363
+ version = "0.14.1"
364
364
  source = { editable = "." }
365
365
  dependencies = [
366
366
  { name = "duckdb" },
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