Skip to content

test: Add coverage for DataFlow.generate_paths edge case and fix broken tests#34

Open
mysticBliss wants to merge 2 commits into
mainfrom
test-dataflow-paths-no-freq-15626198218184403801
Open

test: Add coverage for DataFlow.generate_paths edge case and fix broken tests#34
mysticBliss wants to merge 2 commits into
mainfrom
test-dataflow-paths-no-freq-15626198218184403801

Conversation

@mysticBliss

Copy link
Copy Markdown
Owner

This PR addresses a testing gap where the behavior of DataFlow.generate_paths with no frequency/execution date was not covered. It adds a test case to verify this returns an empty list.
Additionally, it fixes several existing tests in tests/test_data_flow_paths.py that were broken because they incorrectly assumed source_data_format accepted raw format strings, whereas the implementation expects Python expressions (like dt.strftime(...)). These tests were updated to use valid expressions, ensuring the test suite is reliable and green.


PR created automatically by Jules for task 15626198218184403801 started by @mysticBliss

…ests

- Added `test_generate_paths_no_frequency` to `tests/test_data_flow_paths.py` to verify that `generate_paths` returns `[]` when `source_frequency_value` is None.
- Fixed existing tests in `tests/test_data_flow_paths.py` that were failing because they passed raw format strings instead of Python expressions for `source_data_format`.
- Updated `test_generate_paths_invalid_strftime` to properly test `eval()` failure fallback by using invalid Python syntax.

Co-authored-by: mysticBliss <11345806+mysticBliss@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Fixed `AttributeError` in `DataMovements.py` by accessing `_environments` correctly.
- Patched `lit` in `tests/test_integration.py` to fix `ModuleNotFoundError` related to `pyspark.testing`.
- Updated `tests/test_integration.py` assertions to verify interactions on mocked DataProcessor objects instead of uncalled `spark.sql`.
- Added `test_generate_paths_no_frequency` to `tests/test_data_flow_paths.py` to cover the `DataFlow` edge case where frequency is None.
- Fixed existing tests in `tests/test_data_flow_paths.py` to use valid Python expressions for `source_data_format`.

Co-authored-by: mysticBliss <11345806+mysticBliss@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

1 participant