Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from sdc_etl_libs.sdc_data_schema.schema_toolbox import SchemaToolbox 

2 

3 

4class SDCFile(object): 

5 type = None 

6 file_name = None 

7 file_path = None 

8 file_obj = None 

9 schema = None 

10 

11 def __init__(self, schema_, endpoint_schema_, file_name_, file_path_, file_obj_): 

12 self.schema = schema_ 

13 self.endpoint_schema = endpoint_schema_ 

14 self.file_name = file_name_ 

15 self.file_path = file_path_ 

16 self.file_obj = file_obj_ 

17 self.ep_file_info_opts = self.endpoint_schema["info"]["file_info"]["opts"] 

18 self.compression_type = self.ep_file_info_opts.get("compression_type") 

19 self.args = {} 

20 self.args = SchemaToolbox.generate_file_output_args(self.schema, self.endpoint_schema) 

21 

22 def get_file_size(self): 

23 pass 

24 

25 def get_file_as_object(self): 

26 return self.file_obj 

27 

28 def get_file_as_dataframe(self): 

29 raise Exception("Base file to dataframe not allowed.")