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

Can't translate block to text when using CORGIS w/ a variable argument #116

Open
thomaswp opened this issue Dec 5, 2022 · 1 comment
Open

Comments

@thomaswp
Copy link

thomaswp commented Dec 5, 2022

The blocks-to-text translations stops working if I use a CORGIS get function with a variable as the argument.

For example, this code works fine...

import airlines

print(airlines.get('Airport.Name','Airport.Code','ATL'))

However, if I use a variable in the airlines.get call, the code can't be translated back to python anymore.

import airlines

code = 'ATL'
print(airlines.get('Airport.Name','Airport.Code',code))

It still run in python, and editing the python updates the blocks, but not vice-versa. The line does turn blue (instead of the brown of a dataset, or of uncompilable code)

image

Stack trace:

Uncaught TypeError: Cannot read properties of undefined (reading 'match')
    at Blockly.Python.finish (bootstrap:52:1)
    at Blockly.Generator.workspaceToCode (blockly.js?4826734f:862:39)
    at BlockMirrorBlockEditor.getCode (blockpy.js:862:21)
    at BlockMirrorBlockEditor.changed (blockpy.js:916:5)
    at Blockly.Workspace.fireChangeListener (blockly.js?4826734f:339:447)
    at Blockly.Events.fireNow_ (blockly.js?4826734f:40:391)
Blockly.Python.finish @ bootstrap:52
Blockly.Generator.workspaceToCode @ blockly.js?4826734f:862
BlockMirrorBlockEditor.getCode @ blockpy.js:862
BlockMirrorBlockEditor.changed @ blockpy.js:916
Blockly.Workspace.fireChangeListener @ blockly.js?4826734f:339
Blockly.Events.fireNow_ @ blockly.js?4826734f:40
setTimeout (async)
Blockly.Events.fire @ blockly.js?4826734f:40
Blockly.BlockDragger.fireDragEndEvent_ @ blockly.js?4826734f:310
Blockly.BlockDragger.endBlockDrag @ blockly.js?4826734f:309
Blockly.Gesture.handleUp @ blockly.js?4826734f:434
Blockly.TouchGesture.handleUp @ blockly.js?4826734f:645
h @ blockly.js?4826734f:780

Since using user input with data is a core learning objective, I often encourage my students to do this, and I don't recall it breaking before, so perhaps this is a new issue?

@thomaswp
Copy link
Author

Confirmed this is still an issue on the UDel instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant