feat(encode): add parity helpers#1597
Open
lmeyerov wants to merge 9 commits into
Open
Conversation
3be0a3f to
ff839e2
Compare
ff839e2 to
5c01006
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
call()safelist/runtime/type parity for the new encode entry points.apply_encodings()key introspection and schema artifacts without adding unsupported React component props; label/title helpers are raw column binding only because Graphistry upload rejects label/title complex encodings.Closes #1253
New Encode Entry Points
encode_edge_size: maps edge column values to size encodings with numeric categorical/default mappings.encode_edge_weight: maps edge column values to weight encodings with numeric categorical/default mappings.encode_point_opacity: maps node column values to opacity encodings with numeric categorical/default mappings.encode_edge_opacity: maps edge column values to opacity encodings with numeric categorical/default mappings.encode_point_label: raw-binds the node label column; categorical/default mappings are rejected before complex encoding creation.encode_edge_label: raw-binds the edge label column; categorical/default mappings are rejected before complex encoding creation.encode_point_title: raw-binds the node title column; categorical/default mappings are rejected before complex encoding creation.encode_edge_title: raw-binds the edge title column; categorical/default mappings are rejected before complex encoding creation.Validator-Error Samples
encode_edge_size:Invalid value for parameter 'categorical_mapping' in 'encode_edge_size': categorical_mapping['admin'] must be a numberencode_edge_weight:Invalid value for parameter 'categorical_mapping' in 'encode_edge_weight': categorical_mapping['admin'] must be a numberencode_point_opacity:Invalid value for parameter 'categorical_mapping' in 'encode_point_opacity': categorical_mapping['admin'] must be a numberencode_edge_opacity:Invalid value for parameter 'categorical_mapping' in 'encode_edge_opacity': categorical_mapping['admin'] must be a numberencode_point_label:encode_point_label supports raw column binding only; categorical_mapping/default_mapping would create label/title complex encodings that Graphistry upload rejectsencode_edge_label:encode_edge_label supports raw column binding only; categorical_mapping/default_mapping would create label/title complex encodings that Graphistry upload rejectsencode_point_title:encode_point_title supports raw column binding only; categorical_mapping/default_mapping would create label/title complex encodings that Graphistry upload rejectsencode_edge_title:encode_edge_title supports raw column binding only; categorical_mapping/default_mapping would create label/title complex encodings that Graphistry upload rejectsapply_encodings({"encodePointLabel": ["role", {"admin": "Admin"}]}):React text binding payload supports only [column]; label/title categorical mappings are not supportedLOC Buckets
Compatibility / Planner Surface
Label/Titlecomplex encoding names. The new label/title helpers bind raw columns only./home/lmeyerov/Work/graphistry-js/projects/client-api-react/src/bindings.js; the React component exposes only the existingencodePointSize, point/edge color, axis, and point/edge icon props, so this PR does not add the new helpers toREACT_SETTING_NAMES/KnownReactSettingsDict. New keys are scoped to pygraphistry public helpers, GFQLcall(), andapply_encodings()introspection.GRAPHISTRY_FRONTEND_CONTRACT_VERSION = 1; no server-facing or React component prop contract bump. The version-1 signature was refreshed for the compatibleapply_encodingsintrospection key additions.plans/issue-1253-encode-parity/findings/:encode_edge_size: upload acceptsSize; pygraphistry serializes categorical mapping, but core viz has anedgeSizebranch that does not currently consumemapping.categoricalfor edge size.encode_edge_weight: upload acceptsWeight; pygraphistry + forge ETL have edge-weight mapping paths, while core viz currently skipsweightserver-side interpretation.encode_point_opacity/encode_edge_opacity: upload acceptsOpacity; core viz treats opacity primarily as scalar settings and skipsopacityserver-side interpretation.encode_point_label/encode_edge_label/encode_point_title/encode_edge_title: upload rejectsLabel/Titlecomplex names, so this PR keeps these as raw column binding helpers and rejects mapping/default payloads.python3 -m graphistry.devschemas.export --check.Validation
python3 -m pytest -q graphistry/tests/test_plotter.py -k "encode_parity or apply_encodings or label_complex"-> 11 passed, 66 deselectedpython3 -m pytest -q graphistry/tests/compute/test_call_operations.py -k "encode"-> 10 passed, 16 deselectedpython3 -m pytest -q graphistry/tests/test_dataset_id_invalidation.py -k "encoding_method_invalidates_dataset_id"-> 16 passed, 17 deselectedpython3 -m pytest -q graphistry/tests/compute/test_gfql_call_validation.py -k "encode_parity"-> 12 passed, 62 deselectedpython3 -m pytest -q graphistry/tests/test_schema_artifacts.py graphistry/tests/test_viz_settings.py graphistry/tests/test_validate_settings.py-> 28 passedpython3 -m pytest -q graphistry/tests/ -k "encode"-> 87 passed, 6 skipped, 5053 deselected./bin/ruff.sh [touched python files]-> passed./bin/typecheck.sh [touched production python files]-> passedpython3 -m graphistry.devschemas.export --check-> passedgit diff --check origin/master-> passedorigin/master @ 991c2dfcc44823e8cfeaf3d6653c7237e67a464eafter master moved ahead; no conflicts.client-api-reactaudit -> passed.5c010060dd4a08584b37343a725522117eb3f1ba/ run26272586189, including changed-line coverage, schema artifacts, tck-gfql, full matrix, CodeQL, and Read the Docs.DGX/RAPIDS not run: this touches public encode metadata/control-plane validation and schema artifacts, not DataFrame/cuDF/GPU execution paths.