Skip to content

Commit

Permalink
refactor: unihan-etl: 0.21.1 -> 0.22.1 (#348)
Browse files Browse the repository at this point in the history
unihan-etl uses dataclass-based options.
  • Loading branch information
tony committed Jun 19, 2023
2 parents f688483 + 6e464a2 commit cda4a51
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
8 changes: 8 additions & 0 deletions CHANGES
Expand Up @@ -4,6 +4,14 @@

<!-- Maintainers, insert changes / features for the next release here -->

_Maintenance only, no bug fixes, or new features_

### Internal improvements

- unihan-etl: 0.21.1 -> 0.22.1 (#348):

{obj}`dataclasses.dataclass`-based configuration

## cihai 0.22.1 (2023-06-18)

### Bug fix
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.md
Expand Up @@ -60,7 +60,7 @@ replaced.
You may point to a custom config with the `-c` argument, `$ cihai -c path/to/config.yaml`.

You can also override bootstrapping settings. The "unihan_options" dictionary in Cihai's
configuration will be passed right to {ref}`unihan-etl:index`'s {class}`unihan_etl.process.Packager`
configuration will be passed right to {ref}`unihan-etl:index`'s {class}`unihan_etl.core.Packager`
`option` param, which is then merged on top of unihan-etl's default settings:

```{code-block} yaml
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -57,7 +57,7 @@ python = "^3.8"
appdirs = "*"
PyYAML = "~6.0"
sqlalchemy = {extras = ["mypy"], version = "~2.0"}
unihan-etl = "~=0.21.1"
unihan-etl = "~=0.22.1"

[tool.poetry.group.dev.dependencies]
### Docs ###
Expand Down
8 changes: 4 additions & 4 deletions src/cihai/data/unihan/bootstrap.py
Expand Up @@ -4,7 +4,7 @@
import sqlalchemy
from sqlalchemy import Column, String, Table

from unihan_etl import process as unihan
from unihan_etl import core as unihan
from unihan_etl.constants import UNIHAN_MANIFEST
from unihan_etl.util import merge_dict

Expand All @@ -22,9 +22,9 @@ def bootstrap_unihan(
"""Download, extract and import unihan to database."""
options = merge_dict(UNIHAN_ETL_DEFAULT_OPTIONS.copy(), options)

p = unihan.Packager(options)
p.download()
data = p.export()
unihan_pkgr = unihan.Packager(options)
unihan_pkgr.download()
data = unihan_pkgr.export()
table = create_unihan_table(UNIHAN_FIELDS, metadata)

metadata.create_all(engine)
Expand Down

0 comments on commit cda4a51

Please sign in to comment.