Hamilton UI error at startup due to django-ninja ConfigError
メンテナーはふだん 8 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
調査の方向性
uv add sf-hamilton[ui,sdk] に続けて hamilton ui を実行して失敗を再現し、その後 hamilton/cli/__main__.py と hamilton_ui/commands.py を通ってマイグレーションのステップに至る起動パスを追跡します。新規インストールで django-ninja の ConfigError が発生せずに Hamilton UI を起動できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
A fresh install and running of hamilton ui fails with ninja complaining like this:
ConfigError: The use of `Config` class is removed for ModelSchema, use 'Meta' instead
Thus, I cannot start the Hamilton UI at all to try it out on my machine. I also add the information from my pyproject.toml because maybe it is a dependency issue. From the references below, it looks as if this error is related to django-ninja, whereas I do not understand the details. Who can help as to why this happens?
Current behavior
I perform these two steps:
$ uv add sf-hamilton[ui,sdk]
$ hamilton ui
with the last one failing with the stack trace below.
Relevant Issues With Ninja
- [Info] ModelSchema triggers Pydantic V2 deprecation warning for class-based
Config· Issue #1489 · vitalik/django-ninja - Use
class Metaorclass Config· Issue #1027 · vitalik/django-ninja
Stack Traces
$ uv run hamilton ui
╭────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────────────╮
│ ...\.venv\Lib\site-packages\hamilton\cli\__main__.py:324 in ui │
│ │
│ 321 │ │ ) │
│ 322 │ │ raise typer.Exit(code=1) from e │
│ 323 │ │
│ ❱ 324 │ ctx.invoke( │
│ 325 │ │ commands.run, │
│ 326 │ │ port=port, │
│ 327 │ │ base_dir=base_dir, │
│ │
│ ╭───────────────────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────────────────╮ │
│ │ base_dir = 'C:\\Users\\jhr.INVERSO\\.hamilton\\db' │ │
│ │ commands = <module 'hamilton_ui.commands' from 'C:\\Users\\jhr.INVERSO\\src\\bdag-schaden-doc-ingest\\.venv\\Lib\\site-packages\\hamilton_ui\\commands.py'> │ │
│ │ config_file = None │ │
│ │ ctx = <click.core.Context object at 0x000002126A4EFD90> │ │
│ │ no_migration = False │ │
│ │ no_open = False │ │
│ │ port = 8241 │ │
│ │ settings_file = 'mini' │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ ...\.venv\Lib\site-packages\click\core.py:824 in invoke │
│ │
│ ...\.venv\Lib\site-packages\hamilton_ui\commands.py:131 in run │
│ │
│ 128 │ │ with set_env_variables(env): ╭─────────────────────────────────────── locals ───────────────────────────────────────╮ │
│ 129 │ │ │ settings_file_param = f"--settings={settings_file.value}" │ base_dir = 'C:\\Users\\jhr.INVERSO\\.hamilton\\db' │ │
│ 130 │ │ │ if not no_migration: │ config_file = None │ │
│ ❱ 131 │ │ │ │ execute_from_command_line(["manage.py", "migrate", settings_file_param]) │ env = {'HAMILTON_BASE_DIR': 'C:\\Users\\jhr.INVERSO\\.hamilton\\db'} │ │
│ 132 │ │ │ execute_from_command_line( │ no_migration = False │ │
│ 133 │ │ │ │ # Why insecure? Because we're running locally using django's server whic │ no_open = False │ │
│ 134 │ │ │ │ # is not specifically meant for production. That said, we'll be fixing t │ open_url = 'http://localhost:8241' │ │
│ │ port = 8241 │ │
│ │ settings_file = <SettingsFile.mini: 'server.settings_mini'> │ │
│ │ settings_file_param = '--settings=server.settings_mini' │ │
│ │ thread = <Thread(Thread-2 (_open_when_ready), started daemon 14616)> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ ...\.venv\Lib\site-packages\django\core\management\__init__.py:443 in execute_from_command_line │
│ │
│ 440 def execute_from_command_line(argv=None): ╭───────────────────────────────────── locals ──────────────────────────────────────╮ │
│ 441 │ """Run a ManagementUtility.""" │ argv = ['manage.py', 'migrate', '--settings=server.settings_mini'] │ │
│ 442 │ utility = ManagementUtility(argv) │ utility = <django.core.management.ManagementUtility object at 0x000002126AC2D2B0> │ │
│ ❱ 443 │ utility.execute() ╰───────────────────────────────────────────────────────────────────────────────────╯ │
│ 444 │
│ │
│ ...\.venv\Lib\site-packages\django\core\management\__init__.py:437 in execute │
│ │
│ 434 │ │ elif self.argv[1:] in (["--help"], ["-h"]): │
│ 435 │ │ │ sys.stdout.write(self.main_help_text() + "\n") │
│ 436 │ │ else: │
│ ❱ 437 │ │ │ self.fetch_command(subcommand).run_from_argv(self.argv) │
│ 438 │
│ 439 │
│ 440 def execute_from_command_line(argv=None): │
│ │
│ ╭───────────────────────────────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ args = [] │ │
│ │ options = Namespace(settings='server.settings_mini', pythonpath=None, args=[]) │ │
│ │ parser = CommandParser(prog='manage.py', usage='%(prog)s subcommand [options] [args]', description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', │ │
│ │ add_help=False) │ │
│ │ self = <django.core.management.ManagementUtility object at 0x000002126AC2D2B0> │ │
│ │ subcommand = 'migrate' │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ ...\.venv\Lib\site-packages\django\core\management\base.py:420 in run_from_argv │
│ │
│ 417 │ │ args = cmd_options.pop("args", ()) │
│ 418 │ │ handle_default_options(options) │
│ 419 │ │ try: │
│ ❱ 420 │ │ │ self.execute(*args, **cmd_options) │
│ 421 │ │ except CommandError as e: │
│ 422 │ │ │ if options.traceback: │
│ 423 │ │ │ │ raise │
│ │
│ ╭───────────────────────────────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ args = () │ │
│ │ argv = ['manage.py', 'migrate', '--settings=server.settings_mini'] │ │
│ │ cmd_options = { │ │
│ │ │ 'verbosity': 1, │ │
│ │ │ 'settings': 'server.settings_mini', │ │
│ │ │ 'pythonpath': None, │ │
│ │ │ 'traceback': False, │ │
│ │ │ 'no_color': False, │ │
│ │ │ 'force_color': False, │ │
│ │ │ 'skip_checks': False, │ │
│ │ │ 'app_label': None, │ │
│ │ │ 'migration_name': None, │ │
│ │ │ 'interactive': True, │ │
│ │ │ ... +7 │ │
│ │ } │ │
│ │ options = Namespace(verbosity=1, settings='server.settings_mini', pythonpath=None, traceback=False, no_color=False, force_color=False, skip_checks=False, app_label=None, │ │
│ │ migration_name=None, interactive=True, database='default', fake=False, fake_initial=False, plan=False, run_syncdb=False, check_unapplied=False, prune=False) │ │
│ │ parser = CommandParser(prog='manage.py migrate', usage=None, description='Updates database schema. Manages both apps with migrations and those without.', formatter_class=<class │ │
│ │ 'django.core.management.base.DjangoHelpFormatter'>, conflict_handler='error', add_help=True) │ │
│ │ self = <django.core.management.commands.migrate.Command object at 0x000002126C7F78C0> │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
...
│ ...\.venv\Lib\site-packages\ninja\orm\metaclass.py:23 in from_schema_class │
│ │
│ 20 │ @staticmethod │
│ 21 │ def from_schema_class(name: str, namespace: dict) -> "MetaConf": │
│ 22 │ │ if "Config" in namespace: │
│ ❱ 23 │ │ │ raise ConfigError( # pragma: no cover │
│ 24 │ │ │ │ "The use of `Config` class is removed for ModelSchema, use 'Meta' instea │
│ 25 │ │ │ ) │
│ 26 │ │ if "Meta" in namespace: │
│ │
│ ╭────────────────────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────────────────────╮ │
│ │ name = 'UserOut' │ │
│ │ namespace = { │ │
│ │ │ '__module__': 'trackingserver_auth.schema', │ │
│ │ │ '__qualname__': 'UserOut', │ │
│ │ │ 'Config': <class 'trackingserver_auth.schema.UserOut.Config'>, │ │
│ │ │ '__static_attributes__': (), │ │
│ │ │ 'model_config': { │ │
│ │ │ │ 'from_attributes': True, │ │
│ │ │ │ 'model': <class 'trackingserver_auth.models.User'>, │ │
│ │ │ │ 'model_fields': ['id', 'email', 'first_name', 'last_name'] │ │
│ │ │ }, │ │
│ │ │ '__class_vars__': set(), │ │
│ │ │ '__private_attributes__': {} │ │
│ │ } │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ConfigError: The use of `Config` class is removed for ModelSchema, use 'Meta' instead
Steps to replicate behavior
$ uv init
$ uv add sf-hamilton[ui,sdk]
$ hamilton ui
Library & System Information
- Python 3.13.7
- Windows 11
pyproject.toml:
[project]
requires-python = ">=3.13"
dependencies = [
"langchain-text-splitters>=0.2.0",
"llvmlite>=0.46.0",
"markitdown[all]>=0.1.2",
"pikepdf==10.2.0",
"polars>=1.31.0",
"pyarrow==18.0.0",
"pypdf>=6.6.2",
"pytest>=8.3.5",
"python-dotenv>=1.0.0",
"sf-hamilton[sdk,ui]>=1.89.0",
"shap>=0.49.1",
"snowflake>=1.2.0",
"snowflake-ml-python>=1.24.0",
"snowflake-snowpark-python>=1.30.0",
"toml>=0.10.2",
]
Expected behavior
Hamilton UI server should start such that I can open it via web browser and open the website on localhost.
- 主要言語
- Jupyter Notebook
- スター
- 2.6k
- フォーク
- 228
- 平均マージ
- 10日 7時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/hamilton のほかの issue
-
FunctionInputOutputTypeChecker rejects correct values for fixed-length tuple annotations (tuple[int, str])対応中かも @tarang-tp が 9 日前に担当しました。 オープンbug core-work
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 8 日以内に返信
-
Engine crashes when client sends nan or inf float to UI再び着手できるかも @Exudev が 251 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug SDK
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
apache/hamilton#1458 · コメント 5 件 ·
メンテナーはふだん 8 日以内に返信
-
More detailed type annotations in graph visualizations再び着手できるかも @Nishant-Manocha が 386 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
apache/hamilton#1383 · コメント 4 件 ·
メンテナーはふだん 8 日以内に返信
-
Documentation: add explainer for FastAPI再び着手できるかも @Aditya-Deshwal23 が 206 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンdocumentation
難易度 2/5 1〜2日 初心者へのやさしさ 65/100
apache/hamilton#1304 · コメント 5 件 ·
メンテナーはふだん 8 日以内に返信
-
Link back to github from reference API docs対応中かも @naikvaib が 43 日前に担当しました。 オープンdocumentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/hamilton#572 · コメント 3 件 ·
メンテナーはふだん 8 日以内に返信
apache/hamilton の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/markitdown#2820 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: SCIM Users groups[].value is returned as an integer, causing authentik user discovery to failオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
grokability/snipe-it#20006 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Eyevinn/moqlivemock#166 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
hyperledger/fabric-x-orderer#1409 ·
メンテナーはふだん 3 日以内に返信