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

[QA] Vizro-ai base dashboard tests #607

Merged
merged 188 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
3fddb9c
pure data summary on multi datasets
lingyielia May 29, 2024
75cd1f2
remove nested func
lingyielia May 30, 2024
5790ebc
add in pydantic spike
lingyielia May 31, 2024
7a6e47d
remove graph creation
lingyielia May 31, 2024
a80955a
cleanup
lingyielia May 31, 2024
85d683c
cleanup
lingyielia May 31, 2024
4e8ef07
relocate core builder
lingyielia Jun 3, 2024
7895afa
full string generation
lingyielia Jun 4, 2024
391fe6c
data manager init
lingyielia Jun 5, 2024
26f967c
work with aggrid one dataframe
lingyielia Jun 6, 2024
57b7757
remove data manager
lingyielia Jun 6, 2024
d3dd078
multi dataframe
lingyielia Jun 6, 2024
9896efb
clean up
lingyielia Jun 6, 2024
3db523e
merge
lingyielia Jun 6, 2024
088b858
unify pydantic import
lingyielia Jun 6, 2024
2b1c8af
unify structured output usage
lingyielia Jun 7, 2024
f4d8562
consolidate nodes
lingyielia Jun 7, 2024
41260d5
dummy filter
lingyielia Jun 11, 2024
1541d05
rename data sample
lingyielia Jun 11, 2024
a6b950b
make state a pydantic
lingyielia Jun 11, 2024
bee0be8
add layout placeholder
lingyielia Jun 11, 2024
38fd0b8
make methods private
lingyielia Jun 11, 2024
f3df206
add some initial fallbacks
lingyielia Jun 12, 2024
6ed0d01
clean up
lingyielia Jun 12, 2024
35e1c15
example notebook
lingyielia Jun 12, 2024
e2e03cf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 12, 2024
9f4eda1
decouple plan and build
lingyielia Jun 13, 2024
bc5e501
linting
lingyielia Jun 13, 2024
e60d488
merge
lingyielia Jun 13, 2024
714d851
linting
lingyielia Jun 13, 2024
db96fed
update dependencies
lingyielia Jun 13, 2024
30bf0c2
add changelog
lingyielia Jun 13, 2024
66e5d01
bugfix
lingyielia Jun 13, 2024
ea1b99e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 13, 2024
ff5164d
retry logic
lingyielia Jun 18, 2024
0622f26
bug fix
lingyielia Jun 19, 2024
55d80ee
improve logging
lingyielia Jun 20, 2024
da3b1fa
key error handle
lingyielia Jun 21, 2024
e31cc3c
add todos
lingyielia Jun 21, 2024
e756d8e
clean up
lingyielia Jun 21, 2024
f681e02
refactor page to dashboard portion into langgraph
lingyielia Jun 21, 2024
df9ec6e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 21, 2024
0f07884
merge from main
lingyielia Jun 22, 2024
b671a2f
linting
lingyielia Jun 22, 2024
b75436d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 22, 2024
1b6a911
lint
lingyielia Jun 22, 2024
000dd93
Merge branch 'main' of github.com:mckinsey/vizro into dev/dashboard_g…
lingyielia Jun 25, 2024
41a7106
be more specific about the message type
lingyielia Jun 25, 2024
aa2b37b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 25, 2024
d254f4b
improve typing and model init
lingyielia Jun 25, 2024
f217156
merge
lingyielia Jun 25, 2024
8a022f8
linting
lingyielia Jun 25, 2024
7742758
use with anthoropic models
lingyielia Jun 26, 2024
e6f6b6c
lint
lingyielia Jun 26, 2024
c385704
lint
lingyielia Jun 26, 2024
c756f55
bugfix
lingyielia Jun 26, 2024
190b47e
address comments
lingyielia Jun 27, 2024
16149df
linting
lingyielia Jun 27, 2024
72566c5
Merge branch 'main' of github.com:mckinsey/vizro into dev/dashboard_g…
lingyielia Jun 27, 2024
20bf78e
bug fix
lingyielia Jun 27, 2024
7115fe3
merge
lingyielia Jun 27, 2024
d5a3405
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 27, 2024
d1b02a1
Merge branch 'main' of github.com:mckinsey/vizro into dev/dashboard_g…
lingyielia Jul 3, 2024
df2561f
update string
lingyielia Jul 4, 2024
14e4177
flatten plan and build
lingyielia Jul 4, 2024
9058815
lint
lingyielia Jul 4, 2024
5da09eb
address comments
lingyielia Jul 4, 2024
1600b55
merge
lingyielia Jul 6, 2024
e0b08f4
merge
lingyielia Jul 6, 2024
8106cdf
typo
lingyielia Jul 6, 2024
a4f6ff5
Merge branch 'main' of github.com:mckinsey/vizro into dev/dashboard_g…
lingyielia Jul 8, 2024
6c8a75d
progress bar
lingyielia Jul 9, 2024
e01a639
lint
lingyielia Jul 9, 2024
c7407dc
improve tqdm and add graph
lingyielia Jul 10, 2024
543dab3
lint
lingyielia Jul 10, 2024
5532bce
Merge branch 'main' of github.com:mckinsey/vizro into dev/dashboard_g…
lingyielia Jul 10, 2024
e6cf358
remove import builder
lingyielia Jul 10, 2024
0682377
remove black
lingyielia Jul 10, 2024
62fd67e
update tqdm and return elements
lingyielia Jul 10, 2024
c99c9c2
link filter to component id
lingyielia Jul 11, 2024
69df6e0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 11, 2024
dbd5713
convert df_metadata to dataclass
lingyielia Jul 11, 2024
b265a19
lint
lingyielia Jul 11, 2024
9e00326
better naming
lingyielia Jul 13, 2024
42053ee
minimize input size
lingyielia Jul 13, 2024
77b8615
improve layout
lingyielia Jul 15, 2024
f648771
Merge branch 'main' of github.com:mckinsey/vizro into dev/dashboard_g…
lingyielia Jul 15, 2024
9eafb89
unit test examples
lingyielia Jul 16, 2024
b63c82c
merge
lingyielia Jul 16, 2024
e0fc9e9
bugfix
lingyielia Jul 16, 2024
a17bfbb
update progress bar
lingyielia Jul 16, 2024
7e0cbef
address comments
lingyielia Jul 16, 2024
2a325e4
bugfix
lingyielia Jul 16, 2024
2d4495d
Merge branch 'main' of github.com:mckinsey/vizro into dev/dashboard_g…
lingyielia Jul 16, 2024
77e6903
bugfix
lingyielia Jul 16, 2024
4b09fac
restructure files
lingyielia Jul 16, 2024
5f98ad7
add page build
lingyielia Jul 16, 2024
b427270
add page builder
lingyielia Jul 16, 2024
9973260
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 16, 2024
2cd6145
fix
lingyielia Jul 16, 2024
c99e5ba
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 16, 2024
0f6f564
improve progress tracking
lingyielia Jul 17, 2024
0998fdf
make _get_pydantic_output more testable
lingyielia Jul 17, 2024
457deba
refactor df_info
lingyielia Jul 17, 2024
a97e19c
tidy
lingyielia Jul 17, 2024
30282ce
restructure
lingyielia Jul 17, 2024
6b678a2
refactor page build
lingyielia Jul 18, 2024
24bfb5d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 18, 2024
e1dc74e
lint
lingyielia Jul 18, 2024
009acbe
Merge branch 'dev/dashboard_generator' of github.com:mckinsey/vizro i…
lingyielia Jul 18, 2024
f66cc4f
add code sample and remove unit tests
lingyielia Jul 18, 2024
d65dd18
tidy
lingyielia Jul 18, 2024
def3b77
handle unsupported spec
lingyielia Jul 18, 2024
b955edb
add dashboard launch method
lingyielia Jul 19, 2024
23a035d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 19, 2024
2c97828
lint
lingyielia Jul 19, 2024
0facbbb
refactor layout and add more examples
lingyielia Jul 22, 2024
ab7115c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 22, 2024
4cac939
Merge branch 'main' of github.com:mckinsey/vizro into dev/dashboard_g…
lingyielia Jul 22, 2024
fe48708
improve layout creation
lingyielia Jul 23, 2024
365d875
tidy
lingyielia Jul 23, 2024
3e2da5a
tidy
lingyielia Jul 24, 2024
1f86504
small improvement for 4o and remove run dashboard
lingyielia Jul 26, 2024
8affb8f
improve 4o and handle datepicker
lingyielia Jul 27, 2024
e827605
Merge branch 'main' of github.com:mckinsey/vizro into dev/dashboard_g…
lingyielia Jul 27, 2024
c7df707
merge
lingyielia Jul 27, 2024
c652afb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 27, 2024
b228a44
remove pageid for layout
lingyielia Jul 28, 2024
1de3815
address comments
lingyielia Jul 28, 2024
efa6d41
Merge branch 'main' of github.com:mckinsey/vizro into dev/dashboard_g…
lingyielia Jul 29, 2024
6ba48d9
address comments
lingyielia Jul 29, 2024
af1dc70
Merge branch 'main' of github.com:mckinsey/vizro into dev/dashboard_g…
lingyielia Jul 30, 2024
1c48749
merge
lingyielia Jul 30, 2024
22b40dd
Small example changes
maxschulz-COL Jul 30, 2024
27190a5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 30, 2024
0be1ad9
address comments
lingyielia Jul 30, 2024
5e1f7f7
Small adjustment to run scripts
maxschulz-COL Jul 31, 2024
625ee08
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 31, 2024
9c2e91e
Merge branch 'main' into dev/dashboard_generator
lingyielia Jul 31, 2024
422af17
dashboard generator base tests
l0uden Jul 31, 2024
75c78ec
run tests on every push
l0uden Jul 31, 2024
43d3119
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 31, 2024
336921e
took notebook from original branch
l0uden Jul 31, 2024
e38144a
tests with reruns
l0uden Aug 1, 2024
e378003
delete page check
l0uden Aug 1, 2024
5a699c4
vizro reset in conftest
l0uden Aug 1, 2024
fe261d2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 1, 2024
5b0da83
move vizro reset in conftest
l0uden Aug 1, 2024
c55689c
try except for DuplicateIDError
l0uden Aug 1, 2024
0c8f3ac
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 1, 2024
f3fbe8d
changed prompt
l0uden Aug 2, 2024
9a43cd1
changed prompt by adding word `column`
l0uden Aug 2, 2024
ea5ce5e
changed prompt by adding word `column`
l0uden Aug 2, 2024
839b123
added langsmith tracing
l0uden Aug 2, 2024
bf30b25
page numbers
l0uden Aug 2, 2024
8bb68aa
page numbers
l0uden Aug 2, 2024
dc46099
page numbers
l0uden Aug 2, 2024
487953e
change prompt
l0uden Aug 2, 2024
219a22e
change prompt
l0uden Aug 2, 2024
e00e585
check full tests run
l0uden Aug 2, 2024
120ed9a
reruns
l0uden Aug 2, 2024
7de270a
all tests run
l0uden Aug 5, 2024
4c60243
Merge branch 'main' of https://github.com/mckinsey/vizro into qa/vizr…
l0uden Aug 5, 2024
4971377
no slack
l0uden Aug 5, 2024
56a0b03
no slack
l0uden Aug 5, 2024
55ee93d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 5, 2024
8e7ea68
start dashboard
l0uden Aug 6, 2024
a224512
Merge branch 'main' of https://github.com/mckinsey/vizro into qa/vizr…
l0uden Aug 6, 2024
3d00d7b
chromedriver option
l0uden Aug 6, 2024
e739d59
linting
l0uden Aug 6, 2024
7099e8d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 6, 2024
41e7061
[Docs] Update example for advanced charts with Vizro-AI (#611)
nadijagraca Aug 6, 2024
ee228e6
enable tests run on PR
l0uden Aug 6, 2024
bef31b9
Merge branch 'main' of https://github.com/mckinsey/vizro into qa/vizr…
l0uden Aug 6, 2024
2dd7568
chromedriver to hatch
l0uden Aug 6, 2024
2279136
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 6, 2024
221b46a
test latest selenium
l0uden Aug 6, 2024
9c49c90
dash_duo
l0uden Aug 6, 2024
b2e7a74
urllib3==1.26.19
l0uden Aug 6, 2024
8226e41
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 6, 2024
d74c915
urllib3 fix
l0uden Aug 16, 2024
055ba17
Merge branch 'qa/vizro_ai_dashboard_tests' of https://github.com/mcki…
l0uden Aug 16, 2024
a75b305
Merge branch 'main' of https://github.com/mckinsey/vizro into qa/vizr…
l0uden Aug 16, 2024
ae0160d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 16, 2024
0853d01
linting
l0uden Aug 16, 2024
4406edd
Merge branch 'qa/vizro_ai_dashboard_tests' of https://github.com/mcki…
l0uden Aug 16, 2024
932b1f0
linting
l0uden Aug 16, 2024
ad71da4
uncomment slack notification
l0uden Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.

Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨

- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Removed

- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Added

- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Changed

- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Deprecated

- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Fixed

- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Security

- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
8 changes: 6 additions & 2 deletions vizro-ai/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ dependencies = [
"devtools[pygments]",
"coverage[toml]>=6.5",
"pytest",
"pytest-rerunfailures",
"toml",
"nbformat>=4.2.0",
"pyhamcrest",
"jupyter",
"langchain_community"
"langchain_community",
"dash[testing]",
"chromedriver-autoinstaller>=0.6.4",
"urllib3<2.0.0" # helps to resolve bug with urllib3 timeout from vizro-ai integration tests: https://bugs.launchpad.net/python-jenkins/+bug/2018567
]

[envs.default.env-vars]
Expand All @@ -36,7 +40,7 @@ prep-release = [
pypath = "hatch run python -c 'import sys; print(sys.executable)'"
secrets = "pre-commit run gitleaks --all-files"
test = "pytest tests {args}"
test-integration = "pytest -v tests/integration {args}"
test-integration = "pytest -vs --reruns 1 tests/integration --headless {args}"
test-unit = "pytest tests/unit {args}"
test-unit-coverage = [
"coverage run -m pytest tests/unit {args}",
Expand Down
1 change: 0 additions & 1 deletion vizro-ai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ dependencies = [
"python-dotenv>=1.0.0", # TODO decide env var management to see if we need this
"vizro>=0.1.4", # TODO set upper bound later
"ipython>=8.10.0", # not directly required, pinned by Snyk to avoid a vulnerability: https://app.snyk.io/vuln/SNYK-PYTHON-IPYTHON-3318382
"urllib3>=2.0.7", # not directly required, pinned by Snyk to avoid a vulnerability: https://security.snyk.io/vuln/SNYK-PYTHON-URLLIB3-6002459
"aiohttp>=3.9.2", # not directly required, pinned by Snyk to avoid a vulnerability: https://security.snyk.io/vuln/SNYK-PYTHON-AIOHTTP-6209407
"langchain-core>=0.1.31" # not directly required, pinned by Snyk to avoid a vulnerability: https://security.snyk.io/vuln/SNYK-PYTHON-LANGCHAINCORE-6370598
]
Expand Down
1 change: 0 additions & 1 deletion vizro-ai/snyk/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ langgraph>=0.1.2
python-dotenv>=1.0.0
vizro>=0.1.4
ipython>=8.10.0
urllib3>=2.0.7
aiohttp>=3.9.2
langchain-core>=0.1.31
12 changes: 12 additions & 0 deletions vizro-ai/tests/integration/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pytest
from vizro import Vizro


@pytest.fixture(autouse=True)
def reset_managers():
# this ensures that the managers are reset before and after each test
# the reset BEFORE all tests is important because at pytest test collection, fixtures are evaluated and hence
# the model_manager may be populated with models from other tests
Vizro._reset()
yield
Vizro._reset()
53 changes: 53 additions & 0 deletions vizro-ai/tests/integration/test_dashboard.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"""Tests for dashboard using VizroAI."""

import os

import chromedriver_autoinstaller
import pytest
import vizro.plotly.express as px
from vizro import Vizro
from vizro_ai import VizroAI

vizro_ai = VizroAI()

df1 = px.data.gapminder()
df2 = px.data.stocks()


@pytest.fixture(scope="module", autouse=True)
def setup_test_environment():
# We only need to install chromedriver outside CI.
if not os.getenv("CI"):
chromedriver_autoinstaller.install()


@pytest.mark.filterwarnings("ignore::langchain_core._api.beta_decorator.LangChainBetaWarning")
@pytest.mark.filterwarnings("ignore::UserWarning")
@pytest.mark.filterwarnings("ignore:HTTPResponse.getheader()")
def test_simple_dashboard(dash_duo):
input_text = """
I need a page with 1 table.
The table shows the tech companies stock data.

I need a second page showing 2 cards and one chart.
The first card says 'The Gapminder dataset provides historical data on countries' development indicators.'
The chart is an scatter plot showing life expectancy vs. GDP per capita by country. Life expectancy on the y axis,
GDP per capita on the x axis, and colored by continent.
The second card says 'Data spans from 1952 to 2007 across various countries.'
The layout uses a grid of 3 columns and 2 rows.

Row 1: The first row has three columns:
The first column is occupied by the first card.
The second and third columns are spanned by the chart.

Row 2: The second row mirrors the layout of the first row with respect to chart, but the first column is occupied
by the second card.

Add a filter to filter the scatter plot by continent.
Add a second filter to filter the chart by year.
"""

dashboard = vizro_ai.dashboard([df1, df2], input_text)
app = Vizro().build(dashboard).dash
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
Loading