8000 Merge pull request #621 from InvestmentSystems/616/df-api · static-frame/static-frame@0c1ad33 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 0c1ad33

Browse files
authored
Merge pull request #621 from InvestmentSystems/616/df-api
DFI Protocol
2 parents 1603f64 + 4468f10 commit 0c1ad33

File tree

10 files changed

+1442
-267
lines changed

10 files changed

+1442
-267
lines changed

doc/build_example.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,13 @@ def _attribute(row: sf.Series,
327327
) -> tp.Iterator[str]:
328328

329329
icls = f"sf.{ContainerMap.str_to_cls(row['cls_name']).__name__}" # interface cls
330-
attr = row['signature_no_args'] # drop paren
331-
ctr = f"{icls}{'.' if ctr_method else ''}{ctr_method}({kwa(ctr_kwargs)})"
332-
yield f'{name} = {ctr}'
333-
yield f'{name}.{attr}'
330+
attr = row['signature_no_args']
331+
if attr == 'mloc':
332+
pass
333+
else:
334+
ctr = f"{icls}{'.' if ctr_method else ''}{ctr_method}({kwa(ctr_kwargs)})"
335+
yield f'{name} = {ctr}'
336+
yield f'{name}.{attr}'
334337

335338
@staticmethod
336339
def method(row: sf.Series) -> tp.Iterator[str]:
@@ -1643,6 +1646,10 @@ def method(row: sf.Series) -> tp.Iterator[str]:
16431646
elif attr == '__bool__()':
16441647
yield f'f = {icls}({kwa(FRAME_INIT_A1)})'
16451648
yield f"bool(f)"
1649+
elif attr == '__dataframe__()':
1650+
yield f'f = {icls}({kwa(FRAME_INIT_A1)})'
1651+
yield f'dfi = f.{attr}'
1652+
yield f"tuple(dfi.get_columns())"
16461653
elif attr == '__deepcopy__()':
16471654
yield 'import copy'
16481655
yield f'f = {icls}({kwa(FRAME_INIT_A1)})'

0 commit comments

Comments
 (0)
0