Skip to content

Comments

fix - persist custom_elements to data layer without cloud storage#2589

Merged
hayescode merged 2 commits intoChainlit:mainfrom
jason-raitz:create-custom-elements-without-storage
Oct 14, 2025
Merged

fix - persist custom_elements to data layer without cloud storage#2589
hayescode merged 2 commits intoChainlit:mainfrom
jason-raitz:create-custom-elements-without-storage

Conversation

@jason-raitz
Copy link
Contributor

Suggested fix for #2588.

Changes to chainlit_data_layer:

  • Remove storage client guard statement
  • Change it to a warning if element has byte content but no storage

Additional incremental mypy change to a unrelated file to allow the CI to run

  • adds # type: ignore to a couple of type declaration lines in functions without type declarations

Not included in this PR

  • a fix to allow custom elements with URL metadata, but no cloud storage to persist to the data layer.
  • tests for relevant cases
  • fixes for mirrored logic in some of the other data layer wrappers (like sql_alchemy.py:create_element) which contain similarly restrictive logic in their create_element functions.

changes to chainlit_data_layer:
 - remove storage client guard statement
 - change it to a warning if element has byte content but no storage
 - if cloud storage is configured and content is str, not bytes,
   skips file upload and allows element creation
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. backend Pertains to the Python backend. data layer Pertains to data layers. labels Oct 13, 2025
@hayescode hayescode added this pull request to the merge queue Oct 14, 2025
Merged via the queue into Chainlit:main with commit 149f5de Oct 14, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Pertains to the Python backend. data layer Pertains to data layers. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants