Generated unique temp table names in DataProcessor#17
Conversation
Replaced the hardcoded temporary table name 'datamov_tmp' with a unique name generated using UUID (prefixed with 'temp_') to avoid potential collisions during concurrent execution or when reusing the Spark session. Added `tests/test_data_processor.py` to verify that `create_temp_table_and_resultant_df` generates unique table names for each call. Co-authored-by: mysticBliss <11345806+mysticBliss@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Updated `tests/conftest.py` to attempt importing `pyspark` and `great_expectations` before falling back to mocks. This ensures that in environments where these packages are installed (like CI), the real packages are used. - Updated `tests/test_integration.py` to defensively configure the `spark` fixture mock if it is an instance of `MagicMock`. This sets the return value of `.count()` to an integer to avoid `TypeError: '>' not supported between instances of 'MagicMock' and 'int'`. - Verified locally that tests pass with these changes. Co-authored-by: mysticBliss <11345806+mysticBliss@users.noreply.github.com>
What:
datamov/core/data_processor/DataProcessor.pyto importuuidand generate a unique temporary table name increate_temp_table_and_resultant_df.temp_<uuid_hex>.tests/test_data_processor.pyto test this behavior.Why:
Verification:
tests/test_data_processor.pywhich confirmed that the generated table names are unique and distinct from the old hardcoded name.tests/test_integration.py) and verified via logs that the integration flow also uses the new unique table name format (e.g.,temp_4f38dfbb9c6647648f1c4ebb0c1cdbea). Note:test_integration.pyfails due to a pre-existing unrelated mocking issue, but the log output confirms the fix is active.PR created automatically by Jules for task 3827690947800499909 started by @mysticBliss