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

@data_layer API hook to configure data layer. #1463

Merged
merged 6 commits into from
Nov 7, 2024

Conversation

dokterbob
Copy link
Collaborator

@dokterbob dokterbob commented Oct 22, 2024

@cl.datalayer decorator for configuring data layers, rather than forcing users to override _data_layer.

This is a first step towards full support of pluggable data layers.

@dokterbob dokterbob force-pushed the dokterbob/configurable_data_layer branch from 85fd27f to 8a03e71 Compare October 31, 2024 16:20
@dokterbob dokterbob marked this pull request as ready for review October 31, 2024 16:22
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 31, 2024
@dosubot dosubot bot added the data layer Pertains to data layers. label Oct 31, 2024
@dokterbob dokterbob added architecture Overall project architecture. data layer Pertains to data layers. backend Pertains to the Python backend. review-me Ready for review! e2e-tests Has E2E tests unit-tests Has unit tests. and removed data layer Pertains to data layers. labels Oct 31, 2024
Copy link
Collaborator

@willydouhard willydouhard left a comment

Choose a reason for hiding this comment

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

The old way of setting a custom data layer still works right? Since i dont see the e2e test being updated

backend/chainlit/data/__init__.py Show resolved Hide resolved
@dokterbob
Copy link
Collaborator Author

The old way of setting a custom data layer still works right? Since i dont see the e2e test being updated

It technically might, but it was using a variable intentionally marked as private (e.g. prefixed by _).

The E2E test is updated: https://github.com/Chainlit/chainlit/pull/1463/files#diff-dd1c256dace91e15fad2a2b0f93a821e2dd256dd48ab991c790b059f9bde2d60

I only want to support this API going forward. The old stuff might work and might keep working but should not support it.

@dokterbob dokterbob force-pushed the dokterbob/configurable_data_layer branch from 556105a to 6d7436b Compare November 6, 2024 14:31
@dokterbob dokterbob enabled auto-merge (squash) November 6, 2024 14:42
@dokterbob dokterbob merged commit 82f08bf into main Nov 7, 2024
9 checks passed
@dokterbob dokterbob deleted the dokterbob/configurable_data_layer branch November 7, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Overall project architecture. backend Pertains to the Python backend. data layer Pertains to data layers. e2e-tests Has E2E tests review-me Ready for review! size:L This PR changes 100-499 lines, ignoring generated files. unit-tests Has unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants