data_kit 0.0.6 → 0.0.7

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: 11a12efb158e60cac6e71ac09e37799f811a65e4
4
- data.tar.gz: 66ed506814c7273bdc980ada09049ebaabaa3a52
3
+ metadata.gz: 3fdf7cb54e3359090864cc1f2021822a91b382ba
4
+ data.tar.gz: 065fc5738cad3b21dfd62a79474b326ee2722bc4
5
5
  SHA512:
6
- metadata.gz: f2f3eb974bde2f7bdbdcd34fdc4ea57f4ee64c4876768f436a2a5e54f79eba3254f26247b786bbacee869dea17b91de716950fab97ac8ceeb3843f02d51f8a52
7
- data.tar.gz: e1f92f4116af3087938dfcc715605c7d805dd87b408f0dfa4c9e9494587c925451e0d749c528df5eaac400b063d54efbbf97fdb02e3f783981f02d09e33cbc3d
6
+ metadata.gz: 4d0283c91997c819063e7f7b38aee1cba5a97f8f6c43acc1d321d50945a5728607e2bcf44ae994ba6d7731b46e0e016bc13d0ef765a49348c3f6a6987b6e1297
7
+ data.tar.gz: 5f8b249b33841efcd8d38e4a899ce7a4465b6dcd08c05d77bcb4f42f82bc24f9f957cf319c5cf8c84f83e8c84c2bea854e93206d1fee901f229bc8c690c989c5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- data_kit (0.0.6)
4
+ data_kit (0.0.7)
5
5
  rcsv
6
6
  timeliness
7
7
 
@@ -40,7 +40,8 @@ module DataKit
40
40
  def analyze(csv, options = {})
41
41
  analyzer = new(csv,
42
42
  :keys => options[:keys],
43
- :sampling_rate => options[:sampling_rate]
43
+ :sampling_rate => options[:sampling_rate],
44
+ :use_type_hints => options[:use_type_hints]
44
45
  )
45
46
 
46
47
  analyzer.execute
@@ -1,3 +1,3 @@
1
1
  module DataKit
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -58,7 +58,28 @@ describe DataKit::CSV::SchemaAnalyzer do
58
58
  end
59
59
 
60
60
  it "should execute an analysis without type hints" do
61
- analysis = DataKit::CSV::SchemaAnalyzer.new(csv, :sampling_rate => 0.5, :use_type_hints => false).execute
61
+ analysis = DataKit::CSV::SchemaAnalyzer.new(csv,
62
+ :sampling_rate => 0.5, :use_type_hints => false).execute
63
+
64
+ analysis.type?('id').should == :integer
65
+ analysis.type?('first_name').should == :string
66
+ analysis.type?('last_name').should == :string
67
+ analysis.type?('email').should == :string
68
+ analysis.type?('country').should == :string
69
+ analysis.type?('ip_address').should == :string
70
+ analysis.type?('amount').should == :number
71
+ analysis.type?('active').should == :boolean
72
+ analysis.type?('activated_at').should == :datetime
73
+ analysis.type?('address').should == :string
74
+
75
+ analysis.row_count.should == 10
76
+ analysis.sample_count.should be < 10
77
+ analysis.use_type_hints.should == false
78
+ end
79
+
80
+ it "should execute an analysis with the convenience method" do
81
+ analysis = DataKit::CSV::SchemaAnalyzer.analyze(csv,
82
+ :sampling_rate => 0.5, :use_type_hints => false)
62
83
 
63
84
  analysis.type?('id').should == :integer
64
85
  analysis.type?('first_name').should == :string
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mode Analytics