Skip to content

Commit

Permalink
Merge pull request #330 from emilhe/streaming
Browse files Browse the repository at this point in the history
Streaming
  • Loading branch information
emilhe authored May 28, 2024
2 parents 6d26f0f + 31b7c86 commit d081944
Show file tree
Hide file tree
Showing 49 changed files with 1,814 additions and 1,141 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*.css
registerServiceWorker.js
registerServiceWorker.js
2 changes: 1 addition & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ jobs:
if: ${{ always() }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v1
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
Expand Down Expand Up @@ -134,4 +133,12 @@ dash_extensions/*
inst/*
**/file_system_backend/*
man/*
R/*
R/*

.idea/*
pc_ex1/*
page_components/*
NAMESPACE
DESCRIPTION
jsconfig.json
tmp**.py
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# default_language_version:
# python: python3.9

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
hooks:
- id: ruff
- id: ruff-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
# - id: check-yaml
- id: check-toml
- id: check-added-large-files
- id: check-merge-conflict
additional_dependencies: ["flake8-docstrings", "darglint"]
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
}
18 changes: 13 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file.

## [1.0.16] - 05-28-24

### Added

- Add new `SSE` component, which can receive (and buffer) server sent events such the output from an LLM.
- Add new `LoadingTransform`, which makes it easy to re-use a single (full screen) loading component across the app.
- Add new `BaseModelTransform`, which automates serialization/deserialization of Pydantic `BaseModel` objects.

## [1.0.15] - 05-04-24

### Added
Expand Down Expand Up @@ -160,7 +168,7 @@ All notable changes to this project will be documented in this file.

### Changed

- Reimplementation of the `BeforeAfter` component by @AnnMarieW adding new features and improved mobile compatibility. NB: This is a **breaking** change, please consult the docs for an example using the new syntax
- Reimplementation of the `BeforeAfter` component by @AnnMarieW adding new features and improved mobile compatibility. NB: This is a **breaking** change, please consult the docs for an example using the new syntax
- Improved support for the new `callback(background=True, ...)` syntax adding support for the `set_progress` keyword
- Added syntax sugar for Celery task registration for use with the `CeleryManager` object
- Added explicit raise of `NotImplementedError` for the (deprecated) `long_callback` syntax
Expand Down Expand Up @@ -194,7 +202,7 @@ All notable changes to this project will be documented in this file.

### Changed

- Added info on pypi (has been missing after poetry migration)
- Added info on pypi (has been missing after poetry migration)
- Added `CycleBreakerInput` component, which is to be used instead of the `break_cycle` keyword in 0.1.1
- Fixed introduced bug when mixing imports from `dash` and `dash_extensions.enrich`

Expand Down Expand Up @@ -368,7 +376,7 @@ All notable changes to this project will be documented in this file.

### Change

- Bugfixes in `MultiplexerTransform`, both of dcc.Loading and of proxies firing unintentionally on load.
- Bugfixes in `MultiplexerTransform`, both of dcc.Loading and of proxies firing unintentionally on load.
- Reintroduced the `TriggerTransform` based on community feedback.
- Security fixes of underlying npm packages.

Expand All @@ -383,7 +391,7 @@ All notable changes to this project will be documented in this file.

- Updated `Burger` component; added new properties, added new example, slight changes to interface.
- Updated `multipage_app.py` example; removed dependency on burger menu, removed burger helper function in `multipage.py`.
- Added a `hijack` function to the `DashProxy` object. It can be used to inject app state into other app objects, typically used in frameworks such as dataiku 9.0 where the `Dash` object is constructed outside of the user code context.
- Added a `hijack` function to the `DashProxy` object. It can be used to inject app state into other app objects, typically used in frameworks such as dataiku 9.0 where the `Dash` object is constructed outside of the user code context.

### Remove

Expand Down Expand Up @@ -492,7 +500,7 @@ All notable changes to this project will be documented in this file.

### Added

- A new `enrich` module has been added. It exposes the functionality of previous callback blueprints (and more!) through a drop in replacement of (enriched) Dash components.
- A new `enrich` module has been added. It exposes the functionality of previous callback blueprints (and more!) through a drop in replacement of (enriched) Dash components.
- Added folder of example code.

### Changed
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# CONTRIBUTING

This project was generated by the [dash-component-boilerplate](https://github.com/plotly/dash-component-boilerplate) it contains the minimal set of code required to create your own custom Dash component.

2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
* Go through component doc strings
* Add docs for dynamic components
* Add docs for dynamic components
10 changes: 6 additions & 4 deletions _validate_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
DO NOT MODIFY
This file is used to validate your publish settings.
"""

from __future__ import print_function

import importlib
import os
import sys
import importlib


components_package = "dash_extensions"

Expand Down Expand Up @@ -45,14 +45,16 @@ def check_manifest(filename):

def check_file(dist, filename):
if not check_dist(dist, filename):
print(missing_dist_msg.format(filename, components_package, "_js_dist"), file=sys.stderr)
print(
missing_dist_msg.format(filename, components_package, "_js_dist"),
file=sys.stderr,
)
if not check_manifest(filename):
print(missing_manifest_msg.format(filename), file=sys.stderr)


for cur, _, files in os.walk(components_package):
for f in files:

if f.endswith("js"):
# noinspection PyProtectedMember
check_file(components_lib._js_dist, f)
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ignore:
- "dash_extensions/snippets.py"
- "dash_extensions/snippets.py"
4 changes: 2 additions & 2 deletions dash_extensions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from __future__ import print_function as _

import json
import os as _os
import sys as _sys
import json

import dash as _dash

# noinspection PyUnresolvedReferences
from ._imports_ import *
from ._imports_ import * # noqa: F401, F403
from ._imports_ import __all__

if not hasattr(_dash, "__plotly_dash") and not hasattr(_dash, "development"):
Expand Down
2 changes: 2 additions & 0 deletions dash_extensions/_imports_.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .Lottie import Lottie
from .Mermaid import Mermaid
from .Purify import Purify
from .SSE import SSE
from .WebSocket import WebSocket

__all__ = [
Expand All @@ -21,5 +22,6 @@
"Lottie",
"Mermaid",
"Purify",
"SSE",
"WebSocket"
]
6 changes: 3 additions & 3 deletions dash_extensions/dataiku.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import os
import re
from distutils.dir_util import copy_tree

from dash import Dash
from distutils.dir_util import copy_tree

"""
The purpose of this module is to ease the integration of Dash with Dataiku.
The purpose of this module is to ease the integration of Dash with Dataiku.
"""


def bind_assets_folder(app: Dash, app_id: str, assets_folder: str):
def bind_assets_folder(app: Dash, app_id: str, assets_folder: str): # noqa: C901
"""
Dataiku 10 doesn't support separate asset folders for each Dash app. This function targets fixing this issue by
(1) creating a new asset sub folder for each app, and (2) limiting asset loading to this folder.
Expand Down
Loading

0 comments on commit d081944

Please sign in to comment.