Skip to content
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

Improved component model #629

Merged
merged 38 commits into from
Jun 2, 2023
Merged

Improved component model #629

merged 38 commits into from
Jun 2, 2023

Conversation

levand
Copy link
Contributor

@levand levand commented May 28, 2023

Description of changes

All component instances now inherit from a base Component class defining start and stop methods, and to track their dependencies throughout the system.

The System class has been updated to start and stop all components in dependency order.

All these material changes are in chromadb/config.py

This was necessary to properly implement testing in the new architecture. The new version of the system has more stateful components with (e.g.) active subscriptions. It is necessary to provide an explicit mechanism to shut down the whole stack or else consumers could continue operating unexpectedly in the background and not be garbage collected.

Most of the changes in this PR are to fix existing type signature errors. All components of the system are now subclasses of EnforceOverrides which ensures that all signatures match at runtime, and which operates independently from the type checker (so the #type: ignore is not sufficient to fix it.)

This PR also disables the type-abstract MyPy error code. In my opinion this is an incorrect type rule although there is [https://github.com/python/mypy/issues/4717](active discussion) on the topic.

Test plan

Unit + integration tests updated and passing.

Documentation Changes

No changes to user-facing APIs.

@levand levand requested a review from HammadB May 28, 2023 03:49
@github-actions
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readbility, Modularity, Intuitiveness)

@levand
Copy link
Contributor Author

levand commented May 28, 2023

I have no idea why the tests are failing in CI. They work locally on Python 3.7. Can't make any progress tonight, will revisit in the morning.

@HammadB HammadB closed this Jun 1, 2023
@HammadB HammadB reopened this Jun 1, 2023
@HammadB
Copy link
Collaborator

HammadB commented Jun 1, 2023

I still have to merge in main properly but issue is fixed. Will update soon.

@levand levand merged commit 75f5a81 into main Jun 2, 2023
HammadB added a commit that referenced this pull request Jun 2, 2023
## Description of changes
#629 was left unfinished, this completes the merge to support thin
client error'ing.

## Test plan
Existing tests

## Documentation Changes
None required.
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.

2 participants