Last active
June 9, 2017 13:15
-
-
Save bartlomiejdanek/13f998019c667c305f69358337dba589 to your computer and use it in GitHub Desktop.
backfill import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImportDateStatsFromSparkExportBackfill < ImportDateStatsFromSparkExport | |
FROM_DATE = Date.new(2016, 6, 1) | |
TO_DATE = Date.new(2017, 1, 18) | |
private | |
def process_location(location) | |
(FROM_DATE..TO_DATE).each do |date| | |
$backfill_date = date | |
Rails.logger.info "===> Importing for #{$backfill_date}" | |
super | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SparkExportWrapperBackfill < SparkExportWrapper | |
FILE_DATE_FORMAT = "%Y_%m_%d".freeze | |
private | |
def resource_key | |
@resource_key = "#{ENV.fetch('SPARK_EXPORT_PATH')}/backfill/#{market_uid}_#{$backfill_date.strftime(FILE_DATE_FORMAT)}.json" | |
Rails.logger.info "===> Resource key #{@resource_key}" | |
@resource_key | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment