gooddata_datawarehouse 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f98f560684ad94b0c65263eb0b8bb39748d3fe8
|
4
|
+
data.tar.gz: 5626327514feed7e85f5541871100b3e28373c0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/spec/datawarehouse_spec.rb
CHANGED
@@ -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
|