51 make everything hashable again#55
Merged
Merged
Conversation
Dags are hashable now. To achieve this, we move the dags map insert to commit, and add a `dag_name` property to the `Commit` object. This is a good idea anyway as there is currently no way to really tell which dag was added in a commit (i.e. there's no connection between a dag's commit message and the dag itself -- this fixes that).
There was a problem hiding this comment.
Pull Request Overview
This PR makes Dags and FnDags content-addressable by making them hashable, aligning with the goal of having everything be content-addressed except for Heads and Indexes. The changes update the repository structure to properly handle dag naming and references.
- Removes
hash=[]decorators from Dag and FnDag classes to enable content addressing - Adds
dag_namefield to Commit class for tracking dag names in the tree - Updates commit and begin operations to properly handle dag references and naming
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/daggerml_cli/repo.py | Core changes making Dag/FnDag hashable, adding dag_name to Commit, and updating commit/begin logic |
| tests/test_repo.py | Adds assertion to verify cache_path is not None |
| tests/test_api.py | Adds test assertion for unroll functionality |
| src/daggerml_cli/api.py | Removes commented out debug code |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| self.user, | ||
| message or f"merge {c2.id} with {c1.id}", | ||
| created or now(), | ||
| created=created or now(), |
There was a problem hiding this comment.
The parameter name should be updated to match the keyword argument syntax. Change created or now() to use the created= keyword argument pattern consistently with the function signature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dags and Fndags have content addressed IDs now. Everything is content addressed except for Heads (and Indexes).