Skip to content

Instantly share code, notes, and snippets.

@infectious
Last active June 25, 2016 04:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save infectious/5047272 to your computer and use it in GitHub Desktop.
Save infectious/5047272 to your computer and use it in GitHub Desktop.
# Fetch a list of siphons for download from AppNexus
extract :DWAPI do
get 'Siphon'
limit 2
resolve do |response|
rows = []
response.each do |input|
name = input[:name]
hour = input[:hour]
timestamp = input[:timestamp]
input['splits'].each do |split|
rows << { name: name, hour: hour, timestamp: timestamp, split: split['part'] }
end
end
rows
end
end
load :RDW do
into :data_siphons
insert_ignore
end
-------------
etl/apn/data_siphon/fetch.rb:13:in `[]': can't convert String into Integer (TypeError)
from etl/apn/data_siphon/fetch.rb:13:in `block (3 levels) in initialize'
from etl/apn/data_siphon/fetch.rb:12:in `each'
from etl/apn/data_siphon/fetch.rb:12:in `block (2 levels) in initialize'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment