You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the column encoding utility on Windows leads to problems when providing values via the command line. An initial connection to Redshift is established from inside the main() function, but when analyze() is called by multiprocessing.map, the values in the global variables (db_user, db_pwd, etc...) that are passed to analyze() are not those provided in the command line, but rather the values defined by the block earlier in the script (lines 65-84). Some of these variables can be supplied by setting environment variables, however some (e.g. db_pwd, analyze_schema) are expected to be supplied via the command line. As a result, several variables required by analyze() are None.
The Python documentation recommends that for Windows compatibility, that arguments are passed explicitly to functions called via multiprocessing, rather than relying on global variables.
An example of code that works on Linux but not as expected on Windows:
Using the column encoding utility on Windows leads to problems when providing values via the command line. An initial connection to Redshift is established from inside the
main()
function, but whenanalyze()
is called by multiprocessing.map, the values in the global variables (db_user, db_pwd, etc...) that are passed toanalyze()
are not those provided in the command line, but rather the values defined by the block earlier in the script (lines 65-84). Some of these variables can be supplied by setting environment variables, however some (e.g. db_pwd, analyze_schema) are expected to be supplied via the command line. As a result, several variables required byanalyze()
areNone
.The Python documentation recommends that for Windows compatibility, that arguments are passed explicitly to functions called via multiprocessing, rather than relying on global variables.
An example of code that works on Linux but not as expected on Windows:
On Linux the function
f()
sees the updated string, whereas on Windows, "Not Updated" is printed three times.The text was updated successfully, but these errors were encountered: