-
Notifications
You must be signed in to change notification settings - Fork 62
Feat: Create InMemoryTarget
from TaskOnKart
#441
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
base: master
Are you sure you want to change the base?
Feat: Create InMemoryTarget
from TaskOnKart
#441
Conversation
feat: last_modification_time feature in `InMemoryTarget` style: add some type hints fix: fix typo in `InMemoryCacheRepository` test: add some tests for `InMemoryTarget` and `InMemoryCacheRepository`
style: update variable name from `id` to `key`
chore: add type hints style: remove `Protocol`
feat: add the new parameter `cache_in_memory_by_default` to switch default Target style: update the variable name from `target_key` to `data_key` for code consistency test: add tests for `TaskOnKart`s with the `cache_in_memory` parameter
fa0cbd3
to
76cb255
Compare
style: add a type hint
InMemoryTarget
from TargetOnKart
InMemoryTarget
from TargetOnKart
InMemoryTarget
from TaskOnKart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces the InMemoryTarget functionality to TaskOnKart by adding a new parameter (cache_in_memory_by_default) that allows tasks to store outputs in memory rather than on file by default. It also updates tests to confirm correct target creation and behavior and refactors target creation functions for better clarity.
- Added cache_in_memory_by_default parameter and associated methods in TaskOnKart.
- Updated test files to verify that cache targets and file targets are created as expected.
- Refactored make_in_memory_target in the InMemoryTarget module to support an optional unique id.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
test/in_memory/test_task_cached_in_memory.py | Added tests to verify in-memory caching behavior and target paths. |
test/in_memory/test_in_memory_target.py | Updated fixture to use data_key to create in-memory targets. |
gokart/task.py | Introduced cache_in_memory_by_default parameter and logic for default targets. |
gokart/in_memory/target.py | Refactored make_in_memory_target; added helper _make_data_key. |
Comments suppressed due to low confidence (1)
gokart/in_memory/target.py:43
- Typo in the TODO comment: 'migit' should be corrected to 'might'.
# TODO: this module name `_path` migit not be appropriate
TBE