src/astro/sql/operators/agnostic_save_file.py
def execute(self, context):
        """Write SQL table to csv/parquet on local/S3/GCS.

        Infers SQL database type based on connection.
        """

        # Infer db type from `input_conn_id`.
        if type(self.input) == Table:
            df = self.convert_sql_table_to_dataframe()
        elif type(self.input) == pd.DataFrame:
            df = self.input
        else:
            raise ValueError(
                "Expected input_table to be Table or dataframe. Got %s",
                type(self.input),
            )

        # Write file if overwrite == True or if file doesn't exist.
        if self.overwrite == True or not self.file_exists(
            self.output_file_path, self.output_conn_id
        ):
            self.agnostic_write_file(df, self.output_file_path, self.output_conn_id)
        else:
            raise FileExistsError
Write SQL table to csv/parquet on local/S3/GCS.

        Infers SQL database type based on connection.
        
Write SQL table to csv/parquet on local/S3/GCS.
Infers SQL database type based on connection.
Write SQL table to csv / parquet on local / S3 / GCS . Infers SQL database type based on connection .
def execute(self, context):
        if type(self.input) == Table:
            df = self.convert_sql_table_to_dataframe()
        elif type(self.input) == pd.DataFrame:
            df = self.input
        else:
            raise ValueError(
                "Expected input_table to be Table or dataframe. Got %s",
                type(self.input),
            )
        if self.overwrite == True or not self.file_exists(
            self.output_file_path, self.output_conn_id
        ):
            self.agnostic_write_file(df, self.output_file_path, self.output_conn_id)
        else:
            raise FileExistsError
def execute ( self , context ) : if type ( self . input ) == Table : df = self . convert_sql_table_to_dataframe ( ) elif type ( self . input ) == pd . DataFrame : df = self . input else : raise ValueError ( "Expected input_table to be Table or dataframe. Got %s" , type ( self . input ) , ) if self . overwrite == True or not self . file_exists ( self . output_file_path , self . output_conn_id ) : self . agnostic_write_file ( df , self . output_file_path , self . output_conn_id ) else : raise FileExistsError
Write SQL table to csv/parquet on local/S3/GCS.
Write SQL table to csv / parquet on local / S3 / GCS .
"""Write SQL table to csv/parquet on local/S3/GCS.

        Infers SQL database type based on connection.
        """ # Infer db type from `input_conn_id`. # Write file if overwrite == True or if file doesn't exist.
self
context