gooddata_datawarehouse 0.0.4 → 0.0.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: e6c19b17e345eb5ea10f389067f689544bc49ce1
4
- data.tar.gz: 2d7bae04776af43c98eccd798352954d5678e7e2
3
+ metadata.gz: 7f98f560684ad94b0c65263eb0b8bb39748d3fe8
4
+ data.tar.gz: 5626327514feed7e85f5541871100b3e28373c0d
5
5
  SHA512:
6
- metadata.gz: 926f231df825fdb1077d270a8944a9d2631d10f1ca15b1ee4d5a19fb31505a2325088872ff1a6a56b4598e197d90a7410cfaf15685fa0506e372e3829fb9839f
7
- data.tar.gz: 20505562823f04ffb717260115bff12dd649ae0a81331012793fc370de1bc05e37ec73a6fbf7f7040d119e4576ccfc4bb7e8be5cf343bd720327f333949cdd9f
6
+ metadata.gz: 52e171a5c74e80cc056020263d98fe3ca25a28952d7a3ac338356de34003944279ca427370002589d9fb2ad21bdbe32679732f28b19ca2e1c66482e6996fd175
7
+ data.tar.gz: f285e427b6f9216cd578a9fa9f8ebf32d4a2769a62ed4bb1b03c4ea452009d36b91320463519524e9d97a1aece663155b4f45e731bd84af5f29c4893b41d1f0a
@@ -65,8 +65,8 @@ module GoodData
65
65
  # temporary files to get the excepted records (if not given)
66
66
  exc = opts[:exceptions_file] ||= Tempfile.new('exceptions')
67
67
  rej = opts[:rejections_file] ||= Tempfile.new('rejections')
68
- exc = File.new(exc) unless exc.is_a?(File)
69
- rej = File.new(rej) unless rej.is_a?(File)
68
+ exc = File.new(exc, 'w') unless exc.is_a?(File)
69
+ rej = File.new(rej, 'w') unless rej.is_a?(File)
70
70
  end
71
71
 
72
72
  # execute the load
@@ -1,5 +1,5 @@
1
1
  module GoodData
2
2
  class Datawarehouse
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -172,6 +172,22 @@ describe GoodData::Datawarehouse do
172
172
  expected_cols = File.open(CSV_PATH, &:gets).strip.split(',')
173
173
  expect(Set.new(@dwh.get_columns(@random_table_name))).to eq Set.new(expected_cols.map {|c| {:column_name => c, :data_type => GoodData::SQLGenerator::DEFAULT_TYPE}})
174
174
  end
175
+
176
+ it "works with non-existing files" do
177
+ t = Tempfile.new('haha')
178
+ d = File.dirname(t)
179
+
180
+ rej = File.join(d, @random_table_name + '_rej')
181
+ exc = File.join(d, @random_table_name + '_exc')
182
+
183
+ expect(File.exists?(rej)).to be false
184
+ expect(File.exists?(exc)).to be false
185
+
186
+ @dwh.csv_to_new_table(@random_table_name, WRONG_CSV_PATH, :exceptions_file => exc, :rejections_file => rej, :ignore_parse_errors => true)
187
+
188
+ expect(File.size(rej)).to be > 0
189
+ expect(File.size(exc)).to be > 0
190
+ end
175
191
  end
176
192
 
177
193
  describe '#export_table' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gooddata_datawarehouse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Cvengros