Skip to content

Conversation

@wengh
Copy link
Contributor

@wengh wengh commented Mar 11, 2025

Implement streamReader for FakeDataSource.

This pull request introduces significant enhancements to the FakeDataSource in the pyspark_datasources module, including the addition of a streaming capability and refactoring for better code organization. The most important changes include the addition of a streaming reader, the creation of a schema validation function, and updates to the documentation and tests.

Enhancements to FakeDataSource:

  • Added a streaming reader with the FakeDataSourceStreamReader class to support streaming fake data (pyspark_datasources/fake.py).
  • Introduced the _validate_faker_schema function to validate the schema and ensure that the faker library is correctly installed and used (pyspark_datasources/fake.py).

Documentation updates:

  • Updated the documentation to include information about the streaming reader and provided an example of how to use it (pyspark_datasources/fake.py). [1] [2]

Tests:

  • Added a new test test_fake_datasource_stream to verify the functionality of the streaming reader (tests/test_data_sources.py).

Refactoring:

  • Refactored the reader method to use the _validate_faker_schema function and added the streamReader method to the FakeDataSource class (pyspark_datasources/fake.py).

@allisonwang-db allisonwang-db merged commit c9bdbb2 into allisonwang-db:master Apr 29, 2025
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.

2 participants