Ejemplo n.º 1
0
 def to_json(self):
     return {
         "table_name":
         self.table_name,
         "schema": [{
             "column_family": field[0],
             "column_name": field[1],
             "data_type": valid_data_types.to_string(field[2])
         } for field in self.schema],
         "start_tag":
         self.start_row,
         "end_tag":
         self.end_row
     }
Ejemplo n.º 2
0
def atk_dtype_to_pandas_str(dtype):
    """maps ATK schema types to types understood by pandas, returns string"""
    if dtype is not datetime and valid_data_types.is_primitive_type(dtype):
        return valid_data_types.to_string(dtype)
    return "object"
Ejemplo n.º 3
0
 def _schema_to_json(self):
     return [(field[0], valid_data_types.to_string(field[1]))
             for field in self.schema]
Ejemplo n.º 4
0
 def _schema_to_json(self):
     return [(field[0], valid_data_types.to_string(field[1]))
             for field in self.schema]
Ejemplo n.º 5
0
 def to_json(self):
     return {"table_name": self.table_name,
             "schema": [{"column_family" :field[0], "column_name": field[1], "data_type": valid_data_types.to_string(field[2])} for field in self.schema],
             "start_tag": self.start_row,
             "end_tag": self.end_row}
Ejemplo n.º 6
0
def get_rest_str_from_data_type(data_type):
    """Returns the REST string representation for the data type"""
    return valid_data_types.to_string(data_type)  # REST accepts all the Python data types
Ejemplo n.º 7
0
def atk_dtype_to_pandas_str(dtype):
    """maps ATK schema types to types understood by pandas, returns string"""
    if dtype is not datetime and valid_data_types.is_primitive_type(dtype):
        return valid_data_types.to_string(dtype)
    return "object"
Ejemplo n.º 8
0
Archivo: column.py Proyecto: xoltar/atk
 def _as_json_obj(self):
     return { "name": self.name,
              "data_type": valid_data_types.to_string(self.data_type),
              "frame": None if not self.frame else self.frame._id}
Ejemplo n.º 9
0
Archivo: column.py Proyecto: xoltar/atk
 def __repr__(self):
     return '{ "name" : "%s", "data_type" : "%s" }' % (self.name, valid_data_types.to_string(self.data_type))
Ejemplo n.º 10
0
 def _as_json_obj(self):
     return {
         "name": self.name,
         "data_type": valid_data_types.to_string(self.data_type),
         "frame": None if not self.frame else self.frame.uri
     }
Ejemplo n.º 11
0
 def __repr__(self):
     return '{ "name" : "%s", "data_type" : "%s" }' % (
         self.name, valid_data_types.to_string(self.data_type))
Ejemplo n.º 12
0
def get_rest_str_from_data_type(data_type):
    """Returns the REST string representation for the data type"""
    return valid_data_types.to_string(
        data_type)  # REST accepts all the Python data types