sparkle-hypothesis
Hypothesis for Spark Unit tests
Library for easily creating PySpark tests using Hypothesis. Create heterogenious test data with ease
Installation:
pip install sparkle-hypothesis
Example
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')
Metadata
Release files for sparkle-hypothesis 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sparkle-hypothesis-1.4.0.tar.gz | 16.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sparkle_hypothesis-1.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.3 kB
Release files / sparkle-hypothesis-1.4.0.tar.gz
| Download URL | sparkle-hypothesis-1.4.0.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb8349df9f67c7546f4a525130cefa096d1e72fb33e3e0870e4e3579ddbe8986
|
|
BLAKE2b-256 checksum How to use checksums |
04f2b672622367a2e5e48733d4501cde3916a3a42b752b281a88a1109773e6a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.2 Darwin/21.4.0
|
Release files / sparkle_hypothesis-1.4.0-py3-none-any.whl
| Download URL | sparkle_hypothesis-1.4.0-py3-none-any.whl |
|---|---|
| Size | 17.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3361fe1a5dcd79f23af48d205da6b32bf5a76402a46fffca87f29ec2ae7ea3c4
|
|
BLAKE2b-256 checksum How to use checksums |
2cd2c494902513c94777753c1fd1b47a0600e6729b9a5bbd0c4b5ceb10df7714
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.2 Darwin/21.4.0
|