DYN-8088 DSCore.List.Flatten does not work in PythonNet3#16761
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8088
There was a problem hiding this comment.
Pull request overview
This PR addresses DYN-8088, fixing a PythonNet3 issue where DSCore.List.Flatten did not work correctly with Python lists. The fix removes the failure flag from an existing test that was quarantined due to the list interop issue, and adds a new comprehensive test to verify that nested Python lists are properly converted to CLR lists.
Key Changes
- Removed quarantine flags from
TestListDecodingtest now that the runtime fix is implemented - Added
TryDecode_ConvertsNestedPythonListsToClrListstest to validate nested list conversion behavior
| data = [[1, 2, 3], [4, 5, 6]] | ||
| OUT = data, List.Flatten(data, -1) | ||
| "; | ||
| var empty = new ArrayList(); |
There was a problem hiding this comment.
[nitpick] The variable name 'empty' is misleading since it's used as an argument to pythonEvaluator but doesn't reflect its purpose. Consider renaming to something like 'emptyInputs' or 'emptyParameters' to clarify its role in the evaluator call.
| [Test] | ||
| public void TryDecode_ConvertsNestedPythonListsToClrLists() |
There was a problem hiding this comment.
Consider adding a test case that verifies the behavior when List.Flatten is called with different depth parameters (e.g., 0, 1) to ensure the fix handles various flattening levels correctly, not just the complete flatten with -1.
|
Build and failing test will pass once PythonNet3 Engine is updated. I've pumber up the PythonNet3 version to 1.4.6 |
|
@ivaylo-matov Looks like the 1.4.6 version of PythonNet3 is not being picked up by the builds? |
Updated DynamoVisualProgramming.PythonEngine.PythonNet3 package references from version 1.4.6 to 1.4.7 in DynamoCore, PythonMigrationViewExtension, and DynamoPythonTests projects to ensure consistency and access to the latest fixes and features.
Co-authored-by: Ashish Aggarwal <ashish.aggarwal@autodesk.com> (cherry picked from commit 94666f5)
|
Successfully created backport PR for |
|
/cherrypick |
|
Successfully created backport PR for |
) Co-authored-by: Ashish Aggarwal <ashish.aggarwal@autodesk.com> (cherry picked from commit 94666f5)
) Co-authored-by: Ashish Aggarwal <ashish.aggarwal@autodesk.com> (cherry picked from commit 94666f5)
Purpose
This PR is related to DYN-8088 and should be reviewed along the PythonNet3Engine PR#12 .
Declarations
Check these if you believe they are true
Release Notes
Adds a new python test and removes a failure flag.
Reviewers
@zeusongit
@DynamoDS/eidos
FYIs
@dnenov