'DataFrame' object has no attribute 'dtype'

### Describe the bug

I believe my attached program is correct, but it errors out prematurely.  with the error:  DataFrame' object has no attribute 'dtype'.

I've spent many hours trying to debug this.  I know the key trace line is 

```pytb
packages/sklearn/preprocessing/_function_transformer.py", line 177, in _check_inverse_transform
    if not np.issubdtype(X.dtype, np.number):
```

The problem is X is a Pandas DataFrame, which does not have a dtype attribute.  

### Steps/Code to Reproduce

```python
import numpy as np
import pandas as pd
from sklearn.compose import ColumnTransformer
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import FunctionTransformer

data = {
    "date": ["2022-09-15", "2022-09-16", "2022-09-17"],
    "close": [100.0, 101.0, 102.0]
}
df = pd.DataFrame(data)

pipe = Pipeline([
    ('colxform', ColumnTransformer(
        transformers=[
            ("close", FunctionTransformer(func=np.log, inverse_func=np.exp, feature_names_out="one-to-one"), ["close"]),
        ], remainder='passthrough')
    ),
])

pipe.fit(df)
df_xform = pipe.transform(df)
df_inverse = pipe.inverse_transform(df_xform)

assert df == df_inverse
```

### Expected Results

Expecting the round trip thru transform() and inverse_transform() to yield the identity function.  

### Actual Results

```pytb
Traceback (most recent call last):
  File "/Users/gerard/......../src/test/python/bug_function_xformer.py", line 21, in <module>
    pipe.fit(df)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/pipeline.py", line 406, in fit
    self._final_estimator.fit(Xt, y, **fit_params_last_step)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/compose/_column_transformer.py", line 693, in fit
    self.fit_transform(X, y=y)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/utils/_set_output.py", line 142, in wrapped
    data_to_wrap = f(self, X, *args, **kwargs)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/compose/_column_transformer.py", line 726, in fit_transform
    result = self._fit_transform(X, y, _fit_transform_one)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/compose/_column_transformer.py", line 657, in _fit_transform
    return Parallel(n_jobs=self.n_jobs)(
  File "/Users/gerard/......../env/lib/python3.9/site-packages/joblib/parallel.py", line 1048, in __call__
    if self.dispatch_one_batch(iterator):
  File "/Users/gerard/......../env/lib/python3.9/site-packages/joblib/parallel.py", line 864, in dispatch_one_batch
    self._dispatch(tasks)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/joblib/parallel.py", line 782, in _dispatch
    job = self._backend.apply_async(batch, callback=cb)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 208, in apply_async
    result = ImmediateResult(func)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 572, in __init__
    self.results = batch()
  File "/Users/gerard/......../env/lib/python3.9/site-packages/joblib/parallel.py", line 263, in __call__
    return [func(*args, **kwargs)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/joblib/parallel.py", line 263, in <listcomp>
    return [func(*args, **kwargs)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/utils/fixes.py", line 117, in __call__
    return self.function(*args, **kwargs)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/pipeline.py", line 894, in _fit_transform_one
    res = transformer.fit_transform(X, y, **fit_params)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/utils/_set_output.py", line 142, in wrapped
    data_to_wrap = f(self, X, *args, **kwargs)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/utils/_set_output.py", line 142, in wrapped
    data_to_wrap = f(self, X, *args, **kwargs)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/base.py", line 848, in fit_transform
    return self.fit(X, **fit_params).transform(X)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/preprocessing/_function_transformer.py", line 213, in fit
    self._check_inverse_transform(X)
  File "/Users/gerard/......../env/lib/python3.9/site-packages/sklearn/preprocessing/_function_transformer.py", line 177, in _check_inverse_transform
    if not np.issubdtype(X.dtype, np.number):
  File "/Users/gerard/......../env/lib/python3.9/site-packages/pandas/core/generic.py", line 5575, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'dtype'
```

### Versions

```shell
>>> import sklearn; sklearn.show_versions()

System:
    python: 3.9.15 (main, Nov 24 2022, 08:29:02)  [Clang 14.0.6 ]
executable: ......../env/bin/python3
   machine: macOS-10.16-x86_64-i386-64bit

Python dependencies:
      sklearn: 1.2.0
          pip: 22.3.1
   setuptools: 65.5.0
        numpy: 1.23.5
        scipy: 1.8.1
       Cython: 0.29.32
       pandas: 1.4.4
   matplotlib: 3.6.2
       joblib: 1.1.1
threadpoolctl: 2.2.0

Built with OpenMP: True

threadpoolctl info:
       filepath: ......../env/lib/libopenblasp-r0.3.21.dylib
         prefix: libopenblas
       user_api: blas
   internal_api: openblas
        version: 0.3.21
    num_threads: 6
threading_layer: pthreads
   architecture: Haswell

       filepath: ......../env/lib/libomp.dylib
         prefix: libomp
       user_api: openmp
   internal_api: openmp
        version: None
    num_threads: 12
>>>
```

COMMENT:
Also related with https://github.com/scikit-learn/scikit-learn/issues/19905
We introduced the problem in https://github.com/scikit-learn/scikit-learn/pull/19916

Labels: Bug