コード例 #1
0
 def _get_df(self) -> WorkflowDataFrame:
     if isinstance(self._df, Yielded):
         return self._workflow.df(self._df)
     if isinstance(self._df, WorkflowDataFrame):
         assert_or_throw(
             self._df.workflow is self._workflow,
             FugueSQLError(f"{self._key}, {self._df} is from another workflow"),
         )
         return self._df
     return self._workflow.df(self._df)
コード例 #2
0
 def visitFugueDataFrameSource(
     self, ctx: fp.FugueDataFrameSourceContext
 ) -> WorkflowDataFrame:
     name = self.ctxToStr(ctx, delimit="")
     assert_or_throw(name in self.variables, FugueSQLError(f"{name} is not defined"))
     return self.variables[name]
コード例 #3
0
 def last(self) -> WorkflowDataFrame:
     if self._last is None:
         raise FugueSQLError("latest dataframe does not exist")
     return self._last
コード例 #4
0
 def __getitem__(self, key: str) -> WorkflowDataFrame:
     assert_or_throw(key in self._sql_vars,
                     FugueSQLError(f"{key} not found"))
     return self._sql_vars[key]