skrawcz commented on code in PR #1402:
URL: https://github.com/apache/hamilton/pull/1402#discussion_r2404064546
##########
hamilton/cli/logic.py:
##########
@@ -337,3 +338,43 @@ def _read_py_context(file_path: Path) -> dict:
context[k] = getattr(module, k, None)
return context
+
+
+def _read_toml_context(file_path: Path) -> dict:
+ """Read context from a TOML file. For pyproject.toml, looks for Hamilton
configuration in [tool.hamilton] section."""
+ try:
+ import tomli # Using tomli for compatibility with older Python
versions
+ except ImportError:
+ # Provide a helpful error message if tomli is not available
+ raise ImportError(
+ "tomli is required to read TOML files. "
+ "Install it with `pip install tomli` or `pip install
sf-hamilton[cli]` which includes TOML support."
Review Comment:
I don't see this added?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]