Skip to content

Refactor references to use glom#9

Open
Ciemaar wants to merge 5 commits intomasterfrom
modernize-glom-references-2030882082521218350
Open

Refactor references to use glom#9
Ciemaar wants to merge 5 commits intomasterfrom
modernize-glom-references-2030882082521218350

Conversation

@Ciemaar
Copy link
Owner

@Ciemaar Ciemaar commented Mar 11, 2026

This pull request adapts the index_reference and attr_reference functions in closure_collector/closures.py to use the glom library for data traversal and access.

Changes:

  • Added glom>=23.3.0 as a project dependency.
  • Used glom.T and glom.glom to build the specification and fetch the values deep within objects/dicts.
  • Gracefully handled defaults via glom's default keyword argument.
  • Adjusted tests to assert glom.GlomError is raised in the absence of default for non-existent paths.
  • Updated typing configurations to ignore missing glom library stubs.

PR created automatically by Jules for task 2030882082521218350 started by @Ciemaar

- Added `glom` dependency to pyproject.toml and setup.py
- Refactored `index_reference` and `attr_reference` in `closure_collector/closures.py` to build a `glom.T` based specification instead of manually traversing `index`/`getattr`.
- Updated exception handling in tests (`test_closures.py`) to expect `glom.GlomError` instead of `KeyError` or `AttributeError` when there's no default.
- Suppressed `glom` typing imports in `mypy` using `type: ignore` and overrides.

Co-authored-by: Ciemaar <1388496+Ciemaar@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules bot and others added 4 commits March 11, 2026 09:46
- Added `glom` dependency to pyproject.toml and setup.py
- Refactored `index_reference` and `attr_reference` in `closure_collector/closures.py` to build a `glom.T` based specification instead of manually traversing `index`/`getattr`.
- Updated exception handling in tests (`test_closures.py`) to expect `glom.GlomError` instead of `KeyError` or `AttributeError` when there's no default.
- Suppressed `glom` typing imports in `mypy` using `type: ignore` and overrides.
- Added SESSION_INSTRUCTIONS.md containing session documentation.

Co-authored-by: Ciemaar <1388496+Ciemaar@users.noreply.github.com>
- Added `glom` dependency to pyproject.toml
- Refactored `index_reference` and `attr_reference` in `closure_collector/closures.py` to build a `glom.T` based specification.
- Updated exception handling in tests (`test_closures.py`) to expect `glom.GlomError`.
- Fixed `AttributeError` when using `patch` with 'append' on dict objects by validating whether the object has the `append` method, resolving tests in `test_hypothesis.py`.

Co-authored-by: Ciemaar <1388496+Ciemaar@users.noreply.github.com>
- Set `glom` dependency in pyproject.toml
- Refactored `index_reference` and `attr_reference` in `closure_collector/closures.py` to build a `glom.T` based specification.
- Updated exception handling in tests (`test_closures.py`) to expect `glom.GlomError`.
- Fixed `AttributeError` when using `patch` with 'append' on dict objects by validating whether the object has the `append` method, resolving tests in `test_hypothesis.py`.
- Resolved merge conflicts successfully to keep branch up-to-date with master.

Co-authored-by: Ciemaar <1388496+Ciemaar@users.noreply.github.com>
- Added `glom>=23.3.0` to `pyproject.toml` dependencies.
- Updated `closure_collector/closures.py` to use `glom` and `glom.T` for object traversal and data access natively supporting defaults.
- Updated exception assertions in `test/test_closures.py` to expect `GlomError`.
- Cleaned up typing ignores and imports to pass tox lint and type checks.

Co-authored-by: Ciemaar <1388496+Ciemaar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant