<commit_before>#encoding: UTF-8
class Api::Json::ImportsController < Api::ApplicationController
  ssl_required :index, :show, :create

  def index
    imports = current_user.importing_jobs
    render json: { imports: imports.map(&:public_values) }
  end

  def show
    render json: DataImport[params[:id]].public_values
  end

  def create
    file_uri = params[:url].present? ? params[:url] : _upload_file

    if synchronous_import?
      #@data_import = Resque::ImporterJobs.process(current_user[:id], params[:table_name], file_uri)
      #render :json => {:item_queue_id => job_meta.meta_id, :success => true}
    else
    options = { user_id: current_user.id,
                table_name:  params[:table_name].presence,<commit_msg>Maintain the same format on DataImport#index API endpoint<commit_after>#encoding: UTF-8
class Api::Json::ImportsController < Api::ApplicationController
  ssl_required :index, :show, :create

  def index
    imports = current_user.importing_jobs
    render json: { imports: imports.map(&:id), success: true }
  end

  def show
    render json: DataImport[params[:id]].public_values
  end

  def create
    file_uri = params[:url].present? ? params[:url] : _upload_file

    if synchronous_import?
      #@data_import = Resque::ImporterJobs.process(current_user[:id], params[:table_name], file_uri)
      #render :json => {:item_queue_id => job_meta.meta_id, :success => true}
    else
    options = { user_id: current_user.id,
                table_name:  params[:table_name].presence,
{'fraction_non_alphanumeric': 0.11907894736842105, 'fraction_numerical': 0.0013157894736842105, 'mean_word_length': 4.173469387755102, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '520078', 'n_tokens_mistral': 492, 'n_tokens_neox': 477, 'n_words': 104}