Check if the object is a cudf.DataFrame (lazy import). Checks ``sys.modules`` first to avoid importing cudf (which loads CUDA and ~1.5 GiB of RSS) when it hasn't been imported yet. If cudf is not in ``sys.modules``, no object in the process can be a cudf DataFrame.
(obj: Any)
| 132 | |
| 133 | |
| 134 | def _is_cudf_dataframe(obj: Any) -> bool: |
| 135 | """Check if the object is a cudf.DataFrame (lazy import). |
| 136 | |
| 137 | Checks ``sys.modules`` first to avoid importing cudf (which loads CUDA |
| 138 | and ~1.5 GiB of RSS) when it hasn't been imported yet. If cudf is not |
| 139 | in ``sys.modules``, no object in the process can be a cudf DataFrame. |
| 140 | """ |
| 141 | if "cudf" not in sys.modules: |
| 142 | return False |
| 143 | try: |
| 144 | import cudf |
| 145 | |
| 146 | return isinstance(obj, cudf.DataFrame) |
| 147 | except ImportError: |
| 148 | return False |
| 149 | |
| 150 | |
| 151 | def _is_empty_schema(schema: Optional[Schema]) -> bool: |
no outgoing calls
no test coverage detected
searching dependent graphs…