MCPcopy
hub / github.com/ray-project/ray / schema

Method schema

python/ray/data/dataset.py:4160–4185  ·  view source on GitHub ↗

Return the schema of the dataset. Examples: >>> import ray >>> ds = ray.data.range(10) >>> ds.schema() Column Type ------ ---- id int64 Time complexity: O(1) Args: fetch_if_missing:

(self, fetch_if_missing: bool = True)

Source from the content-addressed store, hash-verified

4158 )
4159 @PublicAPI(api_group=IM_API_GROUP)
4160 def schema(self, fetch_if_missing: bool = True) -> Optional["Schema"]:
4161 """Return the schema of the dataset.
4162
4163 Examples:
4164 >>> import ray
4165 >>> ds = ray.data.range(10)
4166 >>> ds.schema()
4167 Column Type
4168 ------ ----
4169 id int64
4170
4171 Time complexity: O(1)
4172
4173 Args:
4174 fetch_if_missing: If True, synchronously fetch the schema if it's
4175 not known. If False, None is returned if the schema is not known.
4176 Default is True.
4177
4178 Returns:
4179 The :class:`ray.data.Schema` class of the records, or None if the
4180 schema is not known and fetch_if_missing is False.
4181 """
4182 base_schema = self._base_schema(fetch_if_missing=fetch_if_missing)
4183 if base_schema is not None:
4184 return Schema(base_schema, data_context=self.context)
4185 return None
4186
4187 @ConsumptionAPI(
4188 if_more_than_read=True,

Callers 15

rename_columnsMethod · 0.95
joinMethod · 0.95
groupbyMethod · 0.95
summaryMethod · 0.95
columnsMethod · 0.95
write_snowflakeMethod · 0.95
to_daskMethod · 0.95
to_marsMethod · 0.95
to_sparkMethod · 0.95
to_arrow_refsMethod · 0.95
_tab_repr_Method · 0.95

Calls 2

_base_schemaMethod · 0.95
SchemaClass · 0.85

Tested by

no test coverage detected