Datalake sample data drops every row that has a null cell
Affected module
Ingestion Framework
Describe the bug
DatalakeSampler._fetch_rows builds the sample rows from data_frame.dropna().values.tolist(). dropna() drops a row when any of its cells is null, so a table with one mostly or fully empty column gives few or no sample rows. Auto classification then gets no values for any column of that table, and the stored sample data is empty.
BurstIQSampler already overrides _fetch_rows with dropna(how="all") for this reason (its records omit fields, so nearly every row has a gap) and turns NaN/NaT into None. The base datalake sampler, used for S3, GCS, ADLS and other datalake files, still drops the rows.
To Reproduce
import pandas as pd
df = pd.DataFrame(
{
"id": [1, 2, 3],
"email": ["[email protected]", "[email protected]", "[email protected]"],
"middle_name": [None, None, None],
}
)
df.dropna().values.tolist() # [] : what DatalakeSampler._fetch_rows returns
DatalakeSampler.fetch_sample_data() on this dataframe (with get_dataframes returning it) returns 0 rows.
Expected behavior
Rows with at least one value are kept and missing cells are returned as null, as BurstIQSampler already does.
Python version
3.12
OpenMetadata version
main (d13d0ad8)
OpenMetadata Ingestion package version
main (d13d0ad8)
Pre-submission checklist
- [x] I searched for duplicate issues.
- [x] I removed credentials, hostnames, emails, and other sensitive data from logs and config.