Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fake streaming source #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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).

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