parameters: (self, repo, file_name, card_name, file_format='CSV')
docstring: Exports the results of a card to a new file in the repo.
  
          Any existing file with that name is overwritten.
  
          Raises PermissionDenied on insufficient privileges or bad query.
docstring_summary: Exports the results of a card to a new file in the repo.
docstring_tokens: Exports the results of a card to a new file in the repo .
function: def export_card(self, repo, file_name, card_name, file_format='CSV'):
          """
          Exports the results of a card to a new file in the repo.
  
          Any existing file with that name is overwritten.
  
          Raises PermissionDenied on insufficient privileges or bad query.
          """
          DataHubManager.has_repo_file_privilege(
              self.username, self.repo_base, repo, 'write')
  
          card = Card.objects.get(repo_base=self.repo_base,
                                  repo_name=repo, card_name=card_name)
          query = card.query
  
          # to export a card, the user must be able to successfully execute
          # the query from their own database user.
          try:
              self.execute_sql(query)
          except Exception:
              raise PermissionDenied(
                  'Either missing required privileges or bad query')
  
          # create the user data folder if it doesn't already exist
          DataHubManager.create_user_data_folder(self.repo_base, repo)
  
          file_name = clean_file_name(file_name)
          file_path = user_data_path(
              self.repo_base, repo, file_name, file_format)
  
          self.user_con.export_query(query=query,
                                     file_path=file_path,
                                     file_format=file_format)
function_tokens: def export_card ( self , repo , file_name , card_name , file_format = 'CSV' ) : DataHubManager . has_repo_file_privilege ( self . username , self . repo_base , repo , 'write' ) card = Card . objects . get ( repo_base = self . repo_base , repo_name = repo , card_name = card_name ) query = card . query # to export a card, the user must be able to successfully execute # the query from their own database user. try : self . execute_sql ( query ) except Exception : raise PermissionDenied ( 'Either missing required privileges or bad query' ) # create the user data folder if it doesn't already exist DataHubManager . create_user_data_folder ( self . repo_base , repo ) file_name = clean_file_name ( file_name ) file_path = user_data_path ( self . repo_base , repo , file_name , file_format ) self . user_con . export_query ( query = query , file_path = file_path , file_format = file_format )