dataduck 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f17a82d0867de39072929e5c32feb32a7ee3d9b2
4
- data.tar.gz: b06b612bf51767f0fa9b4894fd62e031b16bf541
3
+ metadata.gz: 878a28b576d47ad2c2ba6a1df7d984e937bad5dd
4
+ data.tar.gz: 73ef27e0862f684e079a040631fd001a8bade409
5
5
  SHA512:
6
- metadata.gz: 2d8e3440252752f6b056aec6a452f8a36818915cf5b2162453dd499a18d476bb37b56a9f9ffeb961d873acc27a0dd4c89a2ec591ca8ffa28db32f8b06d8342d3
7
- data.tar.gz: 4a570f4d5747f1b8767f8a068a6567bb52993e006bff5f81652aac636ec96ced8f34cec58faf3ca09c13e9f7e2de576cbf7d9eca6247a3cfdeceb1c0224afd85
6
+ metadata.gz: 39e8be0c1acbbd2819a9dad50107ad77d5142ed2fdb7f2b9e946a0ed4fb9d0061db630d7be2004872381c270390fb169033dbeb7a8b10c2db574f5cbe37e6d34
7
+ data.tar.gz: 3b9fcbf4268df2af1d3f6131d4e986c7995b633c56d001578f6e332c95131e3cfea956a46ac9c997fde61c77bd092985d3e5120bfeb6fd585dda8fcd9969752b
data/lib/dataduck/etl.rb CHANGED
@@ -1,4 +1,4 @@
1
- require_relative 'redshift_destination.rb'
1
+ require_relative 'redshift_destination'
2
2
 
3
3
  module DataDuck
4
4
  class ETL
@@ -196,6 +196,7 @@ module DataDuck
196
196
  s3_object = self.upload_table_to_s3!(table)
197
197
  self.create_output_tables!(table)
198
198
  self.query(self.copy_query(table, s3_object.s3_path))
199
+ s3_object.delete!
199
200
 
200
201
  if table.staging_name != table.building_name
201
202
  self.merge_from_staging!(table)
@@ -1,4 +1,5 @@
1
1
  require 'aws-sdk'
2
+ require_relative 'logs'
2
3
 
3
4
  module DataDuck
4
5
  class S3Object
@@ -12,7 +13,24 @@ module DataDuck
12
13
  @region = region
13
14
  end
14
15
 
16
+ def delete!
17
+ Logs.debug("Deleting S3 file #{ self.s3_path }...")
18
+
19
+ s3 = Aws::S3::Client.new(
20
+ region: @region,
21
+ access_key_id: @aws_key,
22
+ secret_access_key: @aws_secret,
23
+ )
24
+
25
+ s3.delete_object({
26
+ bucket: @bucket,
27
+ key: self.full_path,
28
+ })
29
+ end
30
+
15
31
  def upload!
32
+ Logs.debug("Uploading S3 file #{ self.s3_path }...")
33
+
16
34
  s3 = Aws::S3::Client.new(
17
35
  region: @region,
18
36
  access_key_id: @aws_key,
@@ -1,6 +1,6 @@
1
1
  module DataDuck
2
2
  VERSION_MAJOR = 0
3
3
  VERSION_MINOR = 5
4
- VERSION_PATCH = 4
4
+ VERSION_PATCH = 5
5
5
  VERSION = [VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH].join('.')
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dataduck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Pickhardt