Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into feature/update-lite-banner
Browse files Browse the repository at this point in the history
  • Loading branch information
Huong Nguyen committed Nov 20, 2024
2 parents d4e5e39 + e91d156 commit 030cc88
Show file tree
Hide file tree
Showing 65 changed files with 2,182 additions and 2,105 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/all-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
python-version: [ "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
uses: ./.github/workflows/e2e-tests.yml
with:
os: ${{ matrix.os }}
Expand All @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
python-version: [ "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
uses: ./.github/workflows/unit-tests.yml
with:
os: ${{ matrix.os }}
Expand All @@ -34,7 +34,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
uses: ./.github/workflows/lint.yml
with:
os: ${{ matrix.os }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
python-version: [ "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
uses: ./.github/workflows/e2e-tests.yml
with:
os: ${{ matrix.os }}
Expand All @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
python-version: [ "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
uses: ./.github/workflows/unit-tests.yml
with:
os: ${{ matrix.os }}
Expand All @@ -37,7 +37,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
uses: ./.github/workflows/lint.yml
with:
os: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-only-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12" ]
uses: ./.github/workflows/lint.yml
with:
os: ${{ matrix.os }}
Expand Down
3 changes: 2 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ Please follow the established format:

## Major features and improvements

- Add support for Python 3.12
- Update Kedro-Viz telemetry for opt-out model (#2022)
- Introduce `behaviour` prop object with `reFocus` prop (#2161)

## Bug fixes and other changes

- Improve `kedro viz build` usage documentation (#2126)
- Fix unserializable parameters value (#2122)
- Replace `watchgod` library with `watchfiles` and improve autoreload file watching filter (#2134)
- Display full dataset type with library prefix in metadata panel (#2136)
- Enable SQLite WAL mode for Azure ML to fix database locking issues (#2131)
- Replace `flake8`, `isort`, `pylint` and `black` by `ruff` (#2149)
- Refactor `DatasetStatsHook` to avoid showing error when dataset doesn't have file size info (#2174)
- Refactor `node-list-tree` component. (#2193)
- Fix 404 error when accessing the experiment tracking page on the demo site (#2179)
- Add check for port availability before starting Kedro Viz to prevent unintended browser redirects when the port is already in use (#2176)
- Update kedro-viz lite banner icon and message. (#2196)
Expand Down
2 changes: 1 addition & 1 deletion cypress/tests/ui/flowchart/flowchart.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('Flowchart DAG', () => {
const nodeToToggleText = 'Parameters';

// Alias
cy.get(`.pipeline-nodelist__row__checkbox[name=${nodeToToggleText}]`).as(
cy.get(`.toggle-control__checkbox[name=${nodeToToggleText}]`).as(
'nodeToToggle'
);

Expand Down
34 changes: 17 additions & 17 deletions cypress/tests/ui/flowchart/menu.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Flowchart Menu', () => {
});

// Pipeline Label in the Menu
cy.get('.pipeline-nodelist__row__label')
cy.get('.row-text__label')
.first()
.invoke('text')
.should((pipelineLabel) => {
Expand All @@ -57,7 +57,7 @@ describe('Flowchart Menu', () => {
cy.get('.search-input__field').type(searchInput, { force: true });

// Pipeline Label in the Menu
cy.get('.pipeline-nodelist__row__label')
cy.get('.row-text__label')
.first()
.invoke('text')
.should((pipelineLabel) => {
Expand All @@ -72,7 +72,7 @@ describe('Flowchart Menu', () => {

// Action
cy.get(
`.MuiTreeItem-label > .pipeline-nodelist__row > [data-test=nodelist-data-${nodeToClickText}]`
`.MuiTreeItem-label > .node-list-tree-item-row > [data-test=node-list-tree-item--row--${nodeToClickText}]`
)
.should('exist')
.as('nodeToClick');
Expand All @@ -91,7 +91,7 @@ describe('Flowchart Menu', () => {

// Action
cy.get(
`.MuiTreeItem-label > .pipeline-nodelist__row > [data-test=nodelist-data-${nodeToHighlightText}]`
`.MuiTreeItem-label > .node-list-tree-item-row > [data-test=node-list-tree-item--row--${nodeToHighlightText}]`
)
.should('exist')
.as('nodeToHighlight');
Expand All @@ -108,7 +108,7 @@ describe('Flowchart Menu', () => {
const nodeToToggleText = 'Companies';

// Alias
cy.get(`.pipeline-nodelist__row__checkbox[name=${nodeToToggleText}]`, {
cy.get(`.toggle-control__checkbox[name=${nodeToToggleText}]`, {
timeout: 5000,
}).as('nodeToToggle');

Expand All @@ -121,7 +121,7 @@ describe('Flowchart Menu', () => {

// Assert after action
cy.__checkForText__(
`[data-test=nodelist-data-${nodeToToggleText}] > .pipeline-nodelist__row__label--faded`,
`[data-test=node-list-tree-item--row--${nodeToToggleText}] > .row-text__label--faded`,
nodeToToggleText
);
cy.get('.pipeline-node__text').should('not.contain', nodeToToggleText);
Expand All @@ -137,7 +137,7 @@ describe('Flowchart Menu', () => {

// Action
cy.get(
`[for=${nodeToFocusText}-focus] > .pipeline-nodelist__row__icon`
`[for=feature_engineering-focus]`
).click();

// Assert after action
Expand All @@ -161,34 +161,34 @@ describe('Flowchart Menu', () => {
const visibleRowLabel = 'Companies';

// Alias
cy.get(`.pipeline-nodelist__row__checkbox[name=${nodeToToggleText}]`).as(
cy.get(`.toggle-control__checkbox[name=${nodeToToggleText}]`).as(
'nodeToToggle'
);

// Assert before action
cy.get('@nodeToToggle').should('be.checked');
cy.get(
`[data-test=nodelist-data-${visibleRowLabel}] > .pipeline-nodelist__row__label`
`[data-test=node-list-tree-item--row--${visibleRowLabel}] > .row-text__label`
)
.should('not.have.class', 'pipeline-nodelist__row__label--faded')
.should('not.have.class', 'pipeline-nodelist__row__label--disabled');
.should('not.have.class', 'row-text__label--faded')
.should('not.have.class', 'row-text__label--disabled');

// Action
cy.get('@nodeToToggle').uncheck({ force: true });

// Assert after action
cy.get(
`[data-test=nodelist-data-${visibleRowLabel}] > .pipeline-nodelist__row__label`
`[data-test=node-list-tree-item--row--${visibleRowLabel}] > .row-text__label`
)
.should('have.class', 'pipeline-nodelist__row__label--faded')
.should('have.class', 'pipeline-nodelist__row__label--disabled');
.should('have.class', 'row-text__label--faded')
.should('have.class', 'row-text__label--disabled');
});

it('verifies that after checking node type URL should be updated with correct query params', () => {
const nodeToToggleText = 'Parameters';

// Alias
cy.get(`.pipeline-nodelist__row__checkbox[name=${nodeToToggleText}]`).as(
cy.get(`.toggle-control__checkbox[name=${nodeToToggleText}]`).as(
'nodeToToggle'
);

Expand All @@ -207,7 +207,7 @@ describe('Flowchart Menu', () => {
cy.visit(`/?tags=${visibleRowLabel}`);

// Alias
cy.get(`.pipeline-nodelist__row__checkbox[name=${visibleRowLabel}]`).as(
cy.get(`.toggle-control__checkbox[name=${visibleRowLabel}]`).as(
'nodeToToggle'
);

Expand All @@ -220,7 +220,7 @@ describe('Flowchart Menu', () => {
cy.visit('/?types=datasets');

// Alias
cy.get(`.pipeline-nodelist__row__checkbox[name=${visibleRowLabel}]`).as(
cy.get(`.toggle-control__checkbox[name=${visibleRowLabel}]`).as(
'nodeToToggle'
);

Expand Down
8 changes: 4 additions & 4 deletions cypress/tests/ui/toolbar/global-toolbar.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ describe('Global Toolbar', () => {
cy.get('@isPrettyNameCheckbox').should('be.checked');

// Menu
cy.get(`[data-test="nodelist-modularPipeline-${prettifyName(modularPipelineText)}"]`).click();
cy.get(`[data-test="nodelist-${nodeNameType}-${prettyNodeNameText}"]`).should('exist');
cy.get(`[data-test="node-list-tree-item--row--${prettifyName(modularPipelineText)}"]`).click();
cy.get(`[data-test="node-list-tree-item--row--${prettyNodeNameText}"]`).should('exist');

// Flowchart
cy.get('.pipeline-node__text').should('contain', prettyNodeNameText);

// Metadata
cy.get(`[data-test="nodelist-${nodeNameType}-${prettyNodeNameText}"]`).click({ force: true });
cy.get(`[data-test="node-list-tree-item--row--${prettyNodeNameText}"]`).click({ force: true });
cy.get('.pipeline-metadata__title').should(
'have.text',
prettyNodeNameText
Expand All @@ -106,7 +106,7 @@ describe('Global Toolbar', () => {
// Assert after action
cy.__waitForPageLoad__(() => {
// Menu
cy.get(`[data-test="nodelist-${nodeNameType}-${originalNodeNameText}"]`).should('exist');
cy.get(`[data-test="node-list-tree-item--row--${originalNodeNameText}"]`).should('exist');

// Flowchart
cy.get('.pipeline-node__text').should('contain', originalNodeNameText);
Expand Down
2 changes: 1 addition & 1 deletion package/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def before_scenario(context, scenario):

if (
kedro_version
and kedro_version <= parse("0.18.12")
and kedro_version < parse("0.18.12")
and sys.version_info >= (3, 11)
):
print(
Expand Down
6 changes: 4 additions & 2 deletions package/features/steps/lower_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
ipython==7.0.0
fastapi==0.100.0
fsspec==2021.4
fsspec==2021.4; python_version < '3.12'
fsspec==2021.06.01; python_version >= '3.12'
aiofiles==22.1.0
uvicorn[standard]==0.22.0
watchfiles==0.24.0
plotly==4.8
packaging==23.0
pandas==1.3; python_version < '3.10'
pandas==1.5; python_version >= '3.10'
pandas==1.5; python_version >= '3.10' and python_version < '3.12'
pandas==2.1.1; python_version >= '3.12'
sqlalchemy==1.4
strawberry-graphql==0.192.0
networkx==2.5
Expand Down
2 changes: 1 addition & 1 deletion package/kedro_viz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class KedroVizPythonVersionWarning(UserWarning):
"""Custom class for warnings about incompatibilities with Python versions."""


if sys.version_info >= (3, 12):
if sys.version_info >= (3, 13):
warnings.warn(
"""Please be advised that Kedro Viz is not yet fully
compatible with the Python version you are currently using.""",
Expand Down
4 changes: 2 additions & 2 deletions package/tests/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


def test_import_kedro_viz_with_no_official_support_emits_warning(mocker):
"""Test importing kedro Viz with python>=3.12 and controlled warnings should work"""
mocker.patch("kedro_viz.sys.version_info", (3, 12))
"""Test importing kedro Viz with python>=3.13 and controlled warnings should work"""
mocker.patch("kedro_viz.sys.version_info", (3, 13))

# We use the parent class to avoid issues with `exec_module`
with pytest.warns(UserWarning) as record:
Expand Down
49 changes: 49 additions & 0 deletions src/components/filters/filters-group/filters-group.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from 'react';
import classnames from 'classnames';
import FiltersRow from '../filters-row/filters-row';
import { nodeListRowHeight } from '../../../config';
import LazyList from '../../lazy-list';
import { getDataTestAttribute } from '../../../utils/get-data-test-attribute';

import './filters-group.scss';

/** A group collection of FiltersRow */
const FiltersGroup = ({ items = [], group, collapsed, onItemChange }) => (
<LazyList
height={(start, end) => (end - start) * nodeListRowHeight}
total={items.length}
>
{({ start, end, listRef, listStyle }) => (
<ul
ref={listRef}
style={listStyle}
className={classnames('filters-group', {
'filters-group--closed': collapsed,
})}
>
{items.slice(start, end).map((item) => (
<FiltersRow
allUnchecked={group.allUnchecked}
checked={item.checked}
container={'li'}
count={item.count}
dataTest={getDataTestAttribute('node-list-row', 'filter-row')}
id={item.id}
offIndicatorIcon={item.invisibleIcon}
key={item.id}
kind={group.kind}
label={item.highlightedLabel}
name={item.name}
onChange={(e) => onItemChange(e, item)}
onClick={(e) => onItemChange(e, item)}
parentClassName={'node-list-filter-row'}
visible={item.visible}
indicatorIcon={item.visibleIcon}
/>
))}
</ul>
)}
</LazyList>
);

export default FiltersGroup;
15 changes: 15 additions & 0 deletions src/components/filters/filters-group/filters-group.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@use '../../../styles/variables' as var;
@use '../../node-list-tree/styles/variables';

.filters-group {
list-style: none;
padding: 0;
margin: 0 0 1.2em;

// Avoid placeholder fade leaking out for small lists
overflow: hidden;

&--closed {
display: none;
}
}
34 changes: 34 additions & 0 deletions src/components/filters/filters-group/filters-group.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react';
import FiltersGroup from './filters-group';
import { mockState, setup } from '../../../utils/state.mock';
import { getNodeTypes } from '../../../selectors/node-types';
import { getGroupedNodes } from '../../../selectors/nodes';
import { getGroups } from '../../../selectors/filtered-node-list-items';

describe('FiltersGroup Component', () => {
const mockProps = () => {
const items = getGroupedNodes(mockState.spaceflights);
const nodeTypes = getNodeTypes(mockState.spaceflights);
const groups = getGroups({ nodeTypes, items });
return { group: groups['tags'], items: [] };
};

it('renders without throwing', () => {
expect(() => setup.mount(<FiltersGroup {...mockProps()} />)).not.toThrow();
});
it('adds class when collapsed prop true', () => {
const wrapper = setup.mount(
<FiltersGroup {...mockProps()} collapsed={true} />
);
const children = wrapper.find('.filters-group');
expect(children.hasClass('filters-group--closed')).toBe(true);
});

it('removes class when collapsed prop false', () => {
const wrapper = setup.mount(
<FiltersGroup {...mockProps()} collapsed={false} />
);
const children = wrapper.find('.filters-group');
expect(children.hasClass('filters-group--closed')).toBe(false);
});
});
Loading

0 comments on commit 030cc88

Please sign in to comment.