MCPcopy
hub / github.com/pandas-dev/pandas / f

Method f

pandas/io/pytables.py:3847–3880  ·  view source on GitHub ↗
(i, c: str)

Source from the content-addressed store, hash-verified

3845 base_pos = len(_indexables)
3846
3847 def f(i, c: str) -> DataCol:
3848 assert isinstance(c, str)
3849 klass = DataCol
3850 if c in dc:
3851 klass = DataIndexableCol
3852
3853 atom = getattr(desc, c)
3854 adj_name = _maybe_adjust_name(c, self.version)
3855
3856 # TODO: why kind_attr here?
3857 values = getattr(table_attrs, f"{adj_name}_kind", None)
3858 dtype = getattr(table_attrs, f"{adj_name}_dtype", None)
3859 # Argument 1 to "_dtype_to_kind" has incompatible type
3860 # "Optional[Any]"; expected "str" [arg-type]
3861 kind = _dtype_to_kind(dtype) # type: ignore[arg-type]
3862
3863 md = self.read_metadata(c)
3864 # TODO: figure out why these two versions of `meta` dont always match.
3865 # meta = "category" if md is not None else None
3866 meta = getattr(table_attrs, f"{adj_name}_meta", None)
3867
3868 obj = klass(
3869 name=adj_name,
3870 cname=c,
3871 values=values,
3872 kind=kind,
3873 pos=base_pos + i,
3874 typ=atom,
3875 table=self.table,
3876 meta=meta,
3877 metadata=md,
3878 dtype=dtype,
3879 )
3880 return obj
3881
3882 # Note: the definition of `values_cols` ensures that each
3883 # `c` below is a str.

Callers

nothing calls this directly

Calls 3

read_metadataMethod · 0.95
_maybe_adjust_nameFunction · 0.85
_dtype_to_kindFunction · 0.85

Tested by

no test coverage detected