mode 0.0.3 → 0.0.4
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 +4 -4
- data/lib/mode/commands/analyze_field.rb +3 -10
- data/lib/mode/commands/analyze_schema.rb +6 -4
- data/lib/mode/version.rb +1 -1
- metadata +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efdff2f30299e26fcb53225a2ecc9d067b276d00
|
4
|
+
data.tar.gz: c7d5c3e22b7cde0a38f51cf2e01d65d60f199542
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba7761578619bfb884531acfc5d836b26b493db2135b496b98f8b52294b84a495251ad27cd9616a489d2618a2f59791defe381987199fa245b67697a5df77e90
|
7
|
+
data.tar.gz: 49f72b8cdc4fdc5e48299ac4806e7b4eb2e1cae25cedfb29063558001874c9395affa99048e040f65933520924f362dac6f5db374aaed1da6100b0a37b988020
|
@@ -26,16 +26,15 @@ module Mode
|
|
26
26
|
|
27
27
|
field_name = csv.headers[field_pos]
|
28
28
|
|
29
|
-
say "Analyzing #{field_name} at #{path || 'input'}
|
29
|
+
say "Analyzing #{field_name} at #{path || 'input'}"
|
30
30
|
|
31
31
|
analysis, total_time = timer_block do
|
32
32
|
DataKit::CSV::FieldAnalyzer.analyze(csv, field_pos, {
|
33
|
-
:match_type => match_type,
|
34
|
-
:sampling_rate => sampling_rate
|
33
|
+
:match_type => match_type, :sampling_rate => 1
|
35
34
|
})
|
36
35
|
end
|
37
36
|
|
38
|
-
say "Analyzed #{analysis.
|
37
|
+
say "Analyzed #{analysis.row_count} rows in #{'%.2f' % total_time} seconds\n"
|
39
38
|
|
40
39
|
display(analysis)
|
41
40
|
end
|
@@ -59,12 +58,6 @@ module Mode
|
|
59
58
|
def match_type
|
60
59
|
options[:match_type] ? options[:match_type].to_sym : :any
|
61
60
|
end
|
62
|
-
|
63
|
-
def sampling_rate
|
64
|
-
1
|
65
|
-
# file_size = File.size(path)
|
66
|
-
# options[:sample].to_f || DataKit::CSV::SchemaAnalyzer.sampling_rate(file_size)
|
67
|
-
end
|
68
61
|
end
|
69
62
|
end
|
70
63
|
end
|
@@ -24,13 +24,15 @@ module Mode
|
|
24
24
|
|
25
25
|
say "Analyzing #{path || 'input'} (Sampling #{'%.2f' % (100 * sample_rate)}%)..."
|
26
26
|
|
27
|
-
|
27
|
+
analysis, total_time = timer_block do
|
28
28
|
DataKit::CSV::SchemaAnalyzer.analyze(csv, :sampling_rate => sample_rate)
|
29
29
|
end
|
30
30
|
|
31
|
-
|
31
|
+
puts analysis.use_type_hints
|
32
32
|
|
33
|
-
|
33
|
+
say "Analyzed #{analysis.sample_count} of #{analysis.row_count} rows in #{'%.2f' % total_time} seconds\n"
|
34
|
+
|
35
|
+
display(analysis)
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
@@ -81,7 +83,7 @@ module Mode
|
|
81
83
|
|
82
84
|
def sample_rate
|
83
85
|
file_size = File.size(path)
|
84
|
-
options[:sample] || DataKit::CSV::SchemaAnalyzer.sampling_rate(file_size)
|
86
|
+
options[:sample].to_f || DataKit::CSV::SchemaAnalyzer.sampling_rate(file_size)
|
85
87
|
end
|
86
88
|
end
|
87
89
|
end
|
data/lib/mode/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mode Analytics
|
@@ -229,4 +229,3 @@ test_files:
|
|
229
229
|
- spec/fixtures/format_examples.csv.txt
|
230
230
|
- spec/fixtures/format_examples_after_excel.csv.txt
|
231
231
|
- spec/spec_helper.rb
|
232
|
-
has_rdoc:
|