r/databricks • u/22Maxx • 11h ago
Discussion Recommended workflow for (unit) testing that require larger datasets?
I have a case for some unit testing of a rather complex parametrized algorithm that require "larger" datasets (large = single dataset of around 100 MB) that are not supposed to be part of the repo.
So I mainly wonder about the best practices here. As the code itself is inside github, I wonder if it make sense to have the tests be stored inside databricks and then a github action triggering a testing job inside databricks? Or should the data be rather fetched from databricks?
2
Upvotes
1
u/happypofa 10h ago
If you can't declare an algorithm that creates this dataset in memory, then I would use the github actions SP personal schema for a materilized table.
1
u/FunContest9958 3h ago
Large for GitHub but small for Databricks, which means you can generate a dataset very quickly. So your best bet is to generate the data, which most data generation tools will allow you to do deterministically.
Databricks data generator: https://databrickslabs.github.io/dbldatagen/public_docs/repeatable_data_generation.html
Faker: https://faker.readthedocs.io/en/master/index.html#seeding-the-generator