Skip to content

Conversation

sfc-gh-mvashishtha
Copy link
Contributor

@sfc-gh-mvashishtha sfc-gh-mvashishtha commented Jun 25, 2025

Display "modin.pandas" instead of "None" in backend switching logs and progress bars.

Resolves #7611

…' in backend switching logs

- Updated logging in _get_backend_for_auto_switch to show 'modin.pandas' instead of 'None' when class_of_wrapped_fn is None
- Updated corresponding tests to expect the correct log message format
- Functions in the modin.pandas module now properly display their module name in backend switching logs
…_operation

- Fixed switch_operation parameter construction in three locations in query_compiler_caster.py
- All instances now use 'modin.pandas' instead of 'None' when class_of_wrapped_fn is None
- This resolves progress bar messages showing 'None.read_snowflake' instead of 'modin.pandas.read_snowflake'
- Fixes the progress bar issue mentioned by the user where backend switching shows None

Related to issue modin-project#7611
… names

- Added MODIN_PANDAS_MODULE_NAME constant to centralize the magic string
- Created _normalize_class_name() helper function to handle None -> 'modin.pandas' conversion
- Replaced all manual None checks with calls to the helper function
- Reduces code duplication and makes maintenance easier
- No functional changes, all tests still pass

This improves code maintainability by having a single source of truth for the
'modin.pandas' string and eliminates repetitive None-checking logic.
Verify that progress bar messages show the correct switch_operation
(e.g., 'modin.pandas.read_json') instead of 'None.read_json' when
backend switching occurs with the switch_operation parameter.

Also fix import sorting and remove unused imports in test_compiler_caster.py.
Only keep the new progress bar test in test_backend.py
…ssage

- Rename test_progress_bar_shows_switch_operation_correctly to test_progress_bar_message
- Parametrize by switch_operation including None case
- Check complete message format instead of just presence/absence of strings
- Verify exact expected format: 'Transferring data from Ray to Pandas for <operation>' or without operation when None
- Revert test_backend.py changes to keep it focused on backend API
- Add test_progress_bar_shows_modin_pandas_for_general_functions to test_compiler_caster.py
- Verifies that automatic backend switching for general functions like read_json
  shows 'modin.pandas.read_json' instead of 'None.read_json' in progress bar messages
- Ensures our fix for issue modin-project#7611 prevents 'None.read_snowflake' type messages
- Remove unnecessary variable and verbose comment
- Check message starts with correct format directly
- Ensures 'modin.pandas.read_json' appears instead of 'None.read_json'
@sfc-gh-mvashishtha sfc-gh-mvashishtha changed the title FIX-#7611: Display 'modin.pandas' instead of 'None' in backend switching feedback FIX-#7611: Display 'modin.pandas' instead of 'None' in backend switching logs Jun 25, 2025
@sfc-gh-mvashishtha sfc-gh-mvashishtha changed the title FIX-#7611: Display 'modin.pandas' instead of 'None' in backend switching logs FIX-#7611: Display 'modin.pandas' instead of 'None' in backend switching information. Jun 25, 2025
- Remove test_progress_bar_shows_switch_operation_correctly from test_backend.py
- Keep test_backend.py focused on backend API functionality only
- Progress bar testing is now properly handled in test_compiler_caster.py
@sfc-gh-mvashishtha sfc-gh-mvashishtha merged commit 005f26e into modin-project:main Jun 26, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

automatic backend switching logs refer to general functions as None instead of "modin.pandas"

2 participants