Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
7c8dfa0
Add webapp settings
louisdorard Jul 30, 2024
1b5c45a
Add description for new settings
louisdorard Aug 5, 2024
9f2b738
Load new settings into DataEditor
louisdorard Aug 5, 2024
30d3487
Add validate and comment actions
louisdorard Aug 5, 2024
81ff5b4
Build validation and notes columns when replaying edits
louisdorard Aug 5, 2024
c0a13c7
Define validation and notes columns for Tabulator
louisdorard Aug 5, 2024
2cf2de9
Update validation column's Tabulator definition
louisdorard Sep 24, 2024
e1bf5aa
Load val and notes col settings
louisdorard May 12, 2025
3c73f3e
Add val and notes col settings
louisdorard May 12, 2025
ab15978
Revert validate and comment actions
louisdorard May 12, 2025
cdfcfa1
Persist val and notes col settings in custom fields
louisdorard May 12, 2025
3a6536f
Improve settings descriptions
louisdorard May 12, 2025
65559c5
Don't hash val and notes col names
louisdorard May 12, 2025
3db2765
Fix name of val and notes columns
louisdorard May 12, 2025
880841e
Add val and notes cols to original df
louisdorard May 12, 2025
a2c3c9b
Fix creation of val and notes cols
louisdorard May 12, 2025
bb41762
Merge branch 'master' into feature/dss13-sc-180335-validation-column-…
louisdorard May 12, 2025
6efe75d
Bump version number
louisdorard May 12, 2025
c7737b6
Merge branch 'master' into feature/dss13-sc-180335-validation-column-…
louisdorard May 12, 2025
41c4408
Merge continued
louisdorard May 12, 2025
98a99fb
Clarify col names are for display purposes
louisdorard May 12, 2025
143db4c
Fix python env
louisdorard May 15, 2025
58d9aea
Use new settings
louisdorard May 15, 2025
f79b761
Bug fixes
louisdorard May 15, 2025
fd3a6c1
Clean up logging
louisdorard May 15, 2025
15e9a3a
Update tests
louisdorard May 15, 2025
20e6e75
Fixed settings' types
louisdorard May 15, 2025
b3e45ae
Clean up & fix logic to apply edits
louisdorard May 16, 2025
9e52e47
Fix feedback column types
louisdorard May 16, 2025
16e7ab7
Make sure validation column is always read as boolean
louisdorard May 16, 2025
1d419f9
Make sure notes have no missing values
louisdorard May 16, 2025
9576ed5
Use 'boolean' instead of 'bool' type, to better handle missing values
louisdorard May 16, 2025
7662300
Remove superfluous casting
louisdorard May 16, 2025
a0105ae
Use 'boolean' instead of 'bool'
louisdorard May 16, 2025
d5f7acf
Make it easier for pandas to cast as boolean
louisdorard May 16, 2025
30f82a6
Set val & notes col types in edited ds schema
louisdorard May 16, 2025
8190d8f
Centralize val & notes col names
louisdorard May 16, 2025
7e63f28
Add explanations on how to test backend code
louisdorard May 16, 2025
d4866bc
Add title formatters for val & notes cols
louisdorard May 16, 2025
5dbe083
Add explanations
louisdorard May 16, 2025
f89bc20
Fix var name
louisdorard May 19, 2025
60d8cd9
Improve code readibility
louisdorard May 21, 2025
4faca5e
Fix: always cast to "bool" before casting to "boolean"
louisdorard May 21, 2025
6a6119f
Fix casting as boolean
louisdorard May 21, 2025
3a366f7
Improve casting as boolean
louisdorard May 21, 2025
5adfc40
Merge branch 'master' into feature/dss13-sc-180335-validation-column-…
louisdorard May 21, 2025
dea2f41
Add default settings' values
louisdorard May 22, 2025
cc19491
Merge branch 'master' into feature/dss13-sc-180335-validation-column-…
louisdorard May 22, 2025
4389f0e
Rename feedback columns to avoid conflicts with original columns
louisdorard May 27, 2025
76e2dea
Update default feedback co display names
louisdorard May 27, 2025
81a73a1
Update doc and comments
louisdorard May 27, 2025
0e59112
Remove unneeded args/props
louisdorard May 27, 2025
5755fe9
Ensure val values are 'True' or 'False'
louisdorard May 27, 2025
f117b3f
Add missing initialization of DataEditor properties.
fabienDaou May 30, 2025
a757192
Add missing columns in gherkin tests steps.
fabienDaou May 30, 2025
e57eadf
Add webapp logs when test fails.
fabienDaou May 30, 2025
ce79a2b
Ensure all editable columns are in edits_df (even if never edited)
louisdorard Jun 6, 2025
0b60519
Add method to (in)validate row
louisdorard Aug 7, 2025
9f013ee
Add min width for notes column
louisdorard Aug 13, 2025
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
17 changes: 11 additions & 6 deletions dash_tabulator/src/lib/components/DashTabulator.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { extractFilterValues } from '../helpers/dashboardFilters.js'

const crypto = require('crypto');

const plugin_version = "2.0.8";
const plugin_version = "2.1.0";

function md5(string) {
return crypto.createHash('md5').update(string).digest('hex');
Expand Down Expand Up @@ -73,10 +73,15 @@ export default class DashTabulator extends React.Component {
edited.value = cell.getValue()
edited.row = cell.getData()
this.props.setProps({ cellEdited: edited })
if (edited.field == "_visual_edit_validated" | edited.field == "_visual_edit_notes") {
column_name_hash = edited.field
} else {
column_name_hash = md5(edited.field)
}
try {
window.parent.WT1SVC.event("visualedit-edit-cell", {
"dataset_name_hash": md5(datasetName),
"column_name_hash": md5(edited.field),
"column_name_hash": column_name_hash,
"column_type": edited.type,
"plugin_version": plugin_version
});
Expand All @@ -98,24 +103,24 @@ export default class DashTabulator extends React.Component {
handleFilterEvent = (event) => {
const data = event.data;
if (!data || data.type !== 'filters') return;

const filters = data.filters;
if (filters.length === 0) {
this.tabulator.clearFilter();
return;
}

const filter = filters[0];
if (!filter.active || filter.filterType !== 'ALPHANUM_FACET') {
this.tabulator.clearFilter();
return;
}

const columnFields = this.props.columns.map(col => col.field);
if (!columnFields.includes(filter.column)) {
return;
}

const { includedValues, excludedValues } = extractFilterValues(filter);
this.applyTableFilter(filter, includedValues, excludedValues);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/dash-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tabulator_utils = dataiku.import_from_plugin("visual-edit", "tabulator_utils")
dash_tabulator = dataiku.import_from_plugin("visual-edit", "dash_tabulator")
```

Instantiate `DataEditor`, which will later be used to define the data to load into the table:
Instantiate `DataEditor`, which will be used to get the edited data and load it when rendering the table, and to persist edits:

```python
ORIGINAL_DATASET = "orders"
Expand Down
22 changes: 11 additions & 11 deletions docs/editschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ The editschema can be used to add specific UI behavior to editable columns. It i

For each column of the original dataset you can set the following fields:

* `name`: name of a column of the original dataset.
* `type`: allows to override the column's type inferred from the original dataset's schema, or to refine it:
* `boolean_tick` for Boolean columns: formatting and editing of boolean values behaves like a toggle with only 2 states: `true` represented by a green tick icon, and no icon at all otherwise. ![](boolean_tick.gif)
* Note: the default behavior of the "boolean" type uses 3 states: `true` represented by a green tick icon, `false` represented by a red cross, and empty.
* `textarea` for Text columns: this is ideal when values are longer bits of text and provides the following benefits:
* Shows text with carriage returns intact (great for multiline text).
* Adjusts the height of rows to fit cell contents when columns are resized.
* Allows entering of multiple lines of plain text (when the column is editable).
- `name`: name of a column of the original dataset.
- `type`: allows to override the column's type inferred from the original dataset's schema, or to refine it:
- `boolean_tick` for Boolean columns: formatting and editing of boolean values behaves like a toggle with only 2 states: `true` represented by a green tick icon, and no icon at all otherwise. ![](boolean_tick.gif)
- Note: the default behavior of the "boolean" type uses 3 states: `true` represented by a green tick icon, `false` represented by a red cross, and empty.
- `textarea` for Text columns: this is ideal when values are longer bits of text and provides the following benefits:
- Shows text with carriage returns intact (great for multiline text).
- Adjusts the height of rows to fit cell contents when columns are resized.
- Allows entering of multiple lines of plain text (when the column is editable).

## Example

```json
[
{
"name": "validated",
"name": "Tick column",
"type": "boolean_tick"
},
{
"name": "notes",
"name": "Long text column",
"type": "textarea"
},
}
]
```
25 changes: 15 additions & 10 deletions docs/validate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,34 @@ We want business users to validate and make corrections as needed, based on thei

Machine-generated data would be stored in the output dataset of an existing data pipeline. Each row would correspond to an item to validate. Columns would include:

* primary keys;
* machine-generated columns, whose values would change if the pipeline or its algorithms change;
* display-only columns, whose values would help the end-user figure out how to validate/edit/provide feedback.
- primary keys;
- machine-generated columns, whose values would change if the pipeline or its algorithms change;
- display-only columns, whose values would help the end-user figure out how to validate/edit/provide feedback.

Instead of exporting this dataset to Excel, we want end-users to access a web interface to validate and correct the data. In addition to the above columns, we would want 2 feedback columns: one to mark rows as valid (via checkboxes) and one to write comments.
Instead of exporting this dataset to Excel, we want end-users to access a web interface to validate and correct the data. In addition to the above columns, we would want 2 feedback columns: one to mark rows as valid (via checkboxes) and one to write notes.

## Special behavior of the validation column

Validation columns are used to indicate that a human saw what the machine did for a given row, and had the opportunity to make corrections or to fill in missing values if needed.

The webapp’s backend implements special behavior when a cell from a column named "Validated" or "Reviewed" is edited: values of all editable columns from the same row are logged (even if they weren’t edited). This allows the _editlog_ to include not just the information that the row is valid, but also to record the actual values that were validated. This is particularly useful when those values were generated by an algorithm, because they may change if the algorithm changes.
The webapp’s backend implements special behavior when the validation column is ticked: values of all editable columns from the same row are logged, even if they weren’t edited. This allows the _editlog_ to include not just the information that the row is valid, but also to record the actual values that were validated. This is particularly useful when those values were generated by an algorithm, because they may change if the algorithm changes.

As a result, there will be no missing value in the machine-generated and human-reviewed columns that are present in the _edits_ dataset, for rows marked as valid.

## How-to

You must be familiar with the initial [How to Use guide](https://www.dataiku.com/product/plugins/visual-edit/#how-to-use) before following the steps below.

* **Add feedback columns to the dataset to review**: this can be done via code in the existing data pipeline, or with an additional Prepare recipe, as columns with missing values to serve as placeholders in the webapp.
* **When creating a Visual Edit webapp**: make sure to select all machine-generated columns and feedback columns as editable.
* **When using the webapp**: you would review values in generated columns (mark as valid, or edit values and add notes when necessary) and fill in missing values.
- **When creating a Visual Edit webapp**:
- Make sure to select all machine-generated columns as editable.
- Indicate that a validation column is required, and choose a display name for it (e.g. "Validated" or "Reviewed"). This will be used to mark rows as valid. Behind the scenes, values will be stored in a boolean column named `validated`.
- Do the same for a notes column, if needed. Behind the scenes, values will be stored in a string column named `notes`.
- **When using the webapp**:
- Review values in generated columns and edit where necessary (e.g. to correct a value that was generated by an algorithm, or to fill in a missing value).
- Mark rows as valid.
- Write notes where useful.

## Next

* [Build a complete application to test with end-users](build-complete-application)
* [Deploy to production](deploy): this will require collaboration and testing with IT, to propagate the contents of the _edits_ dataset to other systems (columns of this dataset include primary keys, human-reviewed values, a boolean validation column, and additional human feedback columns).
- [Build a complete application to test with end-users](build-complete-application)
- [Deploy to production](deploy): this will require collaboration and testing with IT, to propagate the contents of the _edits_ dataset to other systems (columns of this dataset include primary keys, human-reviewed values, a boolean validation column, and additional human feedback columns).
4 changes: 2 additions & 2 deletions dss-plugin-visual-edit/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.flake8Enabled": false,
"python.pythonPath": "$./venv/bin/python",
"python.defaultInterpreterPath": "./venv/bin/python",
"python.pythonPath": "$(pyenv which python)",
"python.defaultInterpreterPath": "$(pyenv which python)",
"cSpell.words": [
"editlog"
],
Expand Down
Loading