Metadata-Version: 2.1
Name: sparkle-hypothesis
Version: 1.3.0
Summary: Use the power of hypothesis property based testing in PySpark tests
License: GPL-3.0-or-later
Author: Machiel Keizer Groeneveld
Author-email: machielg@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Software Development :: Testing
Requires-Dist: hypothesis (>=5.35.3,<6.0.0)
Requires-Dist: sparkle-session (>=1.2.0,<2.0.0)
Requires-Dist: sparkle-test (>=1.1.0,<2.0.0)
Description-Content-Type: text/markdown

# sparkle-hypothesis
Hypothesis for Spark Unit tests

Library for easily creating PySpark tests using Hypothesis. Create heterogenious test data with ease

Installation:
```bash
pip install sparkle-hypothesis
```

## Example
```python
from sparkle_hypothesis import SparkleHypothesisTestCase, save_dfs

class MyTestCase(SparkleHypothesisTestCase)
    st_groups = st.sampled_from(['Pro', 'Consumer'])

    st_customers = st.fixed_dictionaries(
        {'customer_id:long': st.integers(min_value=1, max_value=10),
        'customer_group:str': st.shared(st_groups, 'group')})

    st_groups = st.fixed_dictionaries(
        {'group_id:long': st.just(1),
         'group_name:str': st.shared(st_groups, 'group'))
         })

    @given(st_customers, st_groups)
    @save_dfs()
    def test_answer_parsing(self, customers: dict, groups:dict):
        customers_df = self.spark.table('customers')
        groups_df = self.spark.table('groups')
```

