Version 1.4.1¶
(Released: 2026-06-05)
This is a compatibility patch that fixes test-suite failures on pandas 2.2+ (Python 3.11 / 3.12 / 3.13) and corrects a Matplotlib colormap-registry regression introduced in the test helpers on older Python 3.9 environments. No public API is changed.
Bug Fixes¶
Fix pandas 2.2+ — ``DataFrame.to_gbq`` removed:
pandas.DataFrame.to_gbqwas dropped in pandas 2.2.DataFramePropertyHandler.writers()inkdiagram.core.propertypreviously evaluatedobj.to_gbqeagerly when building its writer-dispatch dict, causing anAttributeErrorthat cascaded through 25 write-related tests on Python 3.11 / 3.12 / 3.13.Fixed by building the dict without the
.gbqentry and conditionally adding it only whenhasattr(obj, "to_gbq").Fix pandas 2.x / 3.x — ``StringDtype`` not coerced in ``recheck_data_types``:
In pandas 3.x (and pandas 2.x with
future.infer_string=True), string-like DataFrame columns usepd.StringDtypeinstead ofobjectdtype. The previousdtype == "object"guard inrecheck_data_types()did not recogniseStringDtypecolumns, leaving them unconverted and causingTypeError: Cannot interpret StringDtype as a data typewhen downstream code callednp.issubdtypeon the result.Fixed by broadening the column-type check to include
pd.StringDtypealongsideobjectdtype.Fix pandas 2.x — ``UserWarning`` no longer emitted by ``pd.to_datetime``:
Older pandas emitted
UserWarning("Could not infer format …")before raising on mixed-type date columns; pandas 2.x raisesValueErrordirectly without any warning. Two tests intest_utils_validatorexpected that warning and failed with “DID NOT WARN” on Python 3.11 / 3.12 / 3.13.Fixed by emitting the
UserWarningourselves inside theexceptblock ofrecheck_data_types(), keeping behavior consistent across all supported pandas versions.Fix Matplotlib ``ColormapRegistry`` — ``.get_cmap()`` not a method:
The
patch_get_cmaptest fixture calledmatplotlib.colormaps.get_cmap(name);ColormapRegistryexposes subscript access (colormaps[name]) but not.get_cmap(). The call raisedAttributeError, was silently caught, returnedNone, and then_sample_colors("tab10", 12)crashed withTypeError: 'NoneType' object is not callableon local Python 3.9 environments with older Matplotlib.Fixed by switching the fixture to
matplotlib.colormaps[name]with a fallback tomatplotlib.cm.get_cmap(name)for Matplotlib < 3.5.
Testing & QA¶
Tests Updated test assertions for pandas extension types:
Replaced
np.issubdtype(dtype, np.number/floating)calls withpd.api.types.is_numeric_dtype / is_float_dtypeintest_utils_validator— NumPy cannot interpret pandas extension dtypes such asStringDtype.Tests Robust ``is_string_dtype`` guard:
The assertion that a mixed-date column remains unconverted now checks
pd.api.types.is_string_dtyperather thanis_object_dtype, covering bothobject(pandas < 3.x) andStringDtype(pandas 3.x).Tests GBQ mock uses ``raising=False``:
test_write_gbq_passthroughnow passesraising=Falsetomonkeypatch.setattrso the faketo_gbqcan be injected even when the attribute no longer exists onpandas.DataFrame.
Backwards Compatibility Notes¶
No API changes. This is a pure compatibility patch; all public function signatures and return types are unchanged.
The
.gbqwriter is still available at runtime wheneverpandas_gbq(or an equivalent library) has monkey-patchedDataFrame.to_gbqback onto the class.
Acknowledgments¶
Thanks to the CI matrix on Python 3.11 / 3.12 / 3.13 for surfacing the pandas 2.2+ breakage promptly.