Exemple #1
0
 def inspect(self,
             frame,
             n,
             offset,
             selected_columns,
             wrap=None,
             truncate=None,
             round=None,
             width=80,
             margin=None):
     # inspect is just a pretty-print of take, we'll do it on the client
     # side until there's a good reason not to
     result = self.take(frame, n, offset, selected_columns)
     data = result.data
     schema = result.schema
     if wrap:
         from trustedanalytics.core.ui import RowsInspection
         return RowsInspection(data,
                               schema,
                               offset=offset,
                               wrap=wrap,
                               truncate=truncate,
                               round=round,
                               width=width,
                               margin=margin)
     return FrameBackendRest.InspectionTable(schema, data)
Exemple #2
0
 def inspect(self, frame, n, offset, selected_columns, format_settings):
     # inspect is just a pretty-print of take, we'll do it on the client
     # side until there's a good reason not to
     result = self.take(frame, n, offset, selected_columns)
     data = result.data
     schema = result.schema
     return RowsInspection(data, schema, offset=offset, format_settings=format_settings)
Exemple #3
0
 def inspect(self, format_settings=None):
     catalog = server.get(self.uri).json()
     schema = FrameSchema.from_strings_to_types(
         catalog["metadata"]['columns'])
     data = catalog["data"]
     self.rows = map(lambda row: Row(schema, row), data)
     default_format_setting = ui.InspectSettings(wrap=len(schema),
                                                 truncate=10,
                                                 width=200)
     format_settings = default_format_setting if format_settings is None else format_settings
     return RowsInspection(data, schema, 0, format_settings)