When a new value is inserted into a frame, we call pandas.api.types.pandas_dtype(value) to extract the dtype of an object like a pandas Series or numpy array. After #7261, when a scalar value is passed, this usually raises a TypeError, so we construct a local pandas Series from the object and extract the dtype from there.
When the passed value is a date-like string, pandas will instead raise a ValueError because it tries to parse it as a numpy structured dtype. After this fix, we now catch ValueError in addition to TypeError to handle this case.
[x] first commit message and PR title follow format outlined here
NOTE: If you edit the PR title to match this format, you need to add another commit (even if it's empty) or amend your last commit for the CI job that checks the PR title to pick up the new PR title.
What do these changes do?
When a new value is inserted into a frame, we call
pandas.api.types.pandas_dtype(value)
to extract the dtype of an object like a pandas Series or numpy array. After #7261, when a scalar value is passed, this usually raises a TypeError, so we construct a local pandas Series from the object and extract the dtype from there.When the passed value is a date-like string, pandas will instead raise a ValueError because it tries to parse it as a numpy structured dtype. After this fix, we now catch ValueError in addition to TypeError to handle this case.
flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
git commit -s
docs/development/architecture.rst
is up-to-date