Skip to content

Move the core logic from Run.log() to AttributeStore #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

kgodlewski
Copy link
Contributor

AttributeStore.log() is now responsible for feeding data to the OperationsQueue.
Some additional cleanups are there as well.

Base automatically changed from kg/dict-like-api to main December 6, 2024 12:57
@kgodlewski kgodlewski force-pushed the kg/refactor-attribute-store branch from 0c26195 to 70fa6be Compare December 6, 2024 13:16
"""

path = path.strip()
if path in ("", "/"):
if path.strip() in ("", "/"):
Copy link
Contributor

@michalsosn michalsosn Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, since you're not assigning the stripped path back to path, if the path has some whitespace, it will stay and break the 2 checks following immediately below.

E.g.
previously " /path/to/sth/ " -> strip() -> "/path/to/sth/" -> path[1:] -> "path/to/sth/" -> error because it ends with /
now " /path/to/sth/ " -> strip() is not saved -> " /path/to/sth/ " -> path[1:] ignored bc path starts with " " -> " /path/to/sth/ " -> no error because it ends with " "...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add tests

raise ValueError(f"Invalid path: `{path}`. Path components must not be empty.")

if path[0].lstrip() != path[0] or path[-1].rstrip() != path[-1]:
Copy link
Contributor

@michalsosn michalsosn Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, path[0] and path[-1] are substrings of size 0 or 1, so there's no difference between lstrip() and rstrip()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think I missed a split() or two

@michalsosn
Copy link
Contributor

Is it alright that such a major replacement has no changes in tests/? Does not incite confidence..

Copy link
Collaborator

@PatrykGala PatrykGala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please resolve conflicts

`AttributeStore.log()` is now responsible for feeding data to the
`OperationsQueue`
@kgodlewski kgodlewski force-pushed the kg/refactor-attribute-store branch from 70fa6be to 3406313 Compare December 18, 2024 15:02
@kgodlewski kgodlewski force-pushed the kg/refactor-attribute-store branch from 0bf6895 to f933b08 Compare December 18, 2024 16:58
@kgodlewski kgodlewski merged commit 19439a3 into main Dec 19, 2024
9 checks passed
@kgodlewski kgodlewski deleted the kg/refactor-attribute-store branch December 19, 2024 10:24
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.

3 participants