gooddata 0.6.0.pre11 → 0.6.0

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.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +12 -1
  3. data/.yardopts +2 -0
  4. data/README.md +6 -3
  5. data/Rakefile +24 -7
  6. data/gooddata +2 -2
  7. data/gooddata.gemspec +4 -3
  8. data/lib/gooddata.rb +17 -12
  9. data/lib/gooddata/bricks/base_downloader.rb +7 -7
  10. data/lib/gooddata/bricks/brick.rb +7 -8
  11. data/lib/gooddata/bricks/bricks.rb +4 -1
  12. data/lib/gooddata/bricks/middleware/base_middleware.rb +2 -2
  13. data/lib/gooddata/bricks/middleware/bench_middleware.rb +5 -6
  14. data/lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb +21 -22
  15. data/lib/gooddata/bricks/middleware/fs_upload_middleware.rb +3 -4
  16. data/lib/gooddata/bricks/middleware/gooddata_middleware.rb +14 -14
  17. data/lib/gooddata/bricks/middleware/logger_middleware.rb +6 -6
  18. data/lib/gooddata/bricks/middleware/middleware.rb +4 -1
  19. data/lib/gooddata/bricks/middleware/restforce_middleware.rb +29 -32
  20. data/lib/gooddata/bricks/middleware/stdout_middleware.rb +5 -5
  21. data/lib/gooddata/bricks/middleware/twitter_middleware.rb +6 -8
  22. data/lib/gooddata/bricks/utils.rb +3 -3
  23. data/lib/gooddata/cli/cli.rb +4 -2
  24. data/lib/gooddata/cli/commands/api_cmd.rb +6 -4
  25. data/lib/gooddata/cli/commands/auth_cmd.rb +5 -3
  26. data/lib/gooddata/cli/commands/console_cmd.rb +1 -1
  27. data/lib/gooddata/cli/commands/process_cmd.rb +6 -4
  28. data/lib/gooddata/cli/commands/profile_cmd.rb +5 -3
  29. data/lib/gooddata/cli/commands/project_cmd.rb +24 -22
  30. data/lib/gooddata/cli/commands/run_ruby_cmd.rb +12 -10
  31. data/lib/gooddata/cli/commands/scaffold_cmd.rb +8 -6
  32. data/lib/gooddata/cli/hooks.rb +4 -2
  33. data/lib/gooddata/cli/shared.rb +3 -1
  34. data/lib/gooddata/cli/terminal.rb +16 -0
  35. data/lib/gooddata/client.rb +28 -22
  36. data/lib/gooddata/commands/api.rb +43 -26
  37. data/lib/gooddata/commands/auth.rb +22 -53
  38. data/lib/gooddata/commands/base.rb +2 -0
  39. data/lib/gooddata/commands/commands.rb +3 -0
  40. data/lib/gooddata/commands/datasets.rb +39 -136
  41. data/lib/gooddata/commands/process.rb +134 -130
  42. data/lib/gooddata/commands/profile.rb +2 -0
  43. data/lib/gooddata/commands/projects.rb +91 -129
  44. data/lib/gooddata/commands/runners.rb +11 -11
  45. data/lib/gooddata/commands/scaffold.rb +28 -26
  46. data/lib/gooddata/connection.rb +61 -68
  47. data/lib/gooddata/core/core.rb +1 -2
  48. data/lib/gooddata/data/data.rb +7 -0
  49. data/lib/gooddata/data/guesser.rb +114 -0
  50. data/lib/gooddata/exceptions/command_failed.rb +7 -0
  51. data/lib/gooddata/exceptions/exceptions.rb +7 -0
  52. data/lib/gooddata/{exceptions.rb → exceptions/project_not_found.rb} +2 -2
  53. data/lib/gooddata/extensions/big_decimal.rb +5 -0
  54. data/lib/gooddata/extract.rb +2 -0
  55. data/lib/gooddata/goodzilla/goodzilla.rb +11 -12
  56. data/lib/gooddata/helpers.rb +49 -35
  57. data/lib/gooddata/models/attribute.rb +7 -5
  58. data/lib/gooddata/models/dashboard.rb +44 -45
  59. data/lib/gooddata/models/data_result.rb +10 -13
  60. data/lib/gooddata/models/data_set.rb +6 -6
  61. data/lib/gooddata/models/display_form.rb +4 -4
  62. data/lib/gooddata/models/empty_result.rb +4 -3
  63. data/lib/gooddata/models/fact.rb +5 -5
  64. data/lib/gooddata/models/links.rb +3 -1
  65. data/lib/gooddata/models/metadata.rb +34 -32
  66. data/lib/gooddata/models/metric.rb +33 -34
  67. data/lib/gooddata/models/model.rb +165 -173
  68. data/lib/gooddata/models/models.rb +3 -0
  69. data/lib/gooddata/models/process.rb +18 -17
  70. data/lib/gooddata/models/profile.rb +3 -1
  71. data/lib/gooddata/models/project.rb +107 -35
  72. data/lib/gooddata/models/project_metadata.rb +12 -12
  73. data/lib/gooddata/models/report.rb +31 -30
  74. data/lib/gooddata/models/report_data_result.rb +22 -19
  75. data/lib/gooddata/models/report_definition.rb +101 -80
  76. data/lib/gooddata/version.rb +5 -3
  77. data/lib/templates/bricks/brick.rb.erb +3 -3
  78. data/lib/templates/bricks/main.rb.erb +3 -2
  79. data/lib/templates/project/Goodfile.erb +2 -2
  80. data/lib/templates/project/model/model.rb.erb +19 -19
  81. data/spec/data/.gooddata +4 -0
  82. data/spec/helpers/blueprint_helper.rb +2 -2
  83. data/spec/helpers/cli_helper.rb +28 -0
  84. data/spec/helpers/connection_helper.rb +2 -2
  85. data/spec/integration/command_projects_spec.rb +1 -1
  86. data/spec/integration/create_from_template_spec.rb +12 -0
  87. data/spec/integration/full_project_spec.rb +2 -2
  88. data/spec/integration/partial_md_export_import_spec.rb +36 -0
  89. data/spec/logging_in_logging_out_spec.rb +1 -1
  90. data/spec/spec_helper.rb +29 -2
  91. data/spec/unit/cli/cli_spec.rb +3 -3
  92. data/spec/unit/cli/commands/cmd_api_spec.rb +21 -4
  93. data/spec/unit/cli/commands/cmd_auth_spec.rb +2 -4
  94. data/spec/unit/cli/commands/cmd_process_spec.rb +20 -4
  95. data/spec/unit/cli/commands/cmd_profile_spec.rb +9 -4
  96. data/spec/unit/cli/commands/cmd_project_spec.rb +53 -4
  97. data/spec/unit/cli/commands/cmd_run_ruby_spec.rb +2 -4
  98. data/spec/unit/cli/commands/cmd_scaffold_spec.rb +14 -4
  99. data/spec/unit/commands/command_api_spec.rb +21 -2
  100. data/spec/unit/commands/command_auth_spec.rb +62 -1
  101. data/spec/unit/commands/command_dataset_spec.rb +31 -3
  102. data/spec/unit/commands/command_process_spec.rb +75 -1
  103. data/spec/unit/commands/command_profile_spec.rb +7 -1
  104. data/spec/unit/commands/command_projects_spec.rb +1 -1
  105. data/spec/unit/commands/command_scaffold_spec.rb +46 -1
  106. data/spec/unit/core/connection_spec.rb +1 -0
  107. data/spec/unit/data/guesser_spec.rb +54 -0
  108. data/spec/unit/helpers_spec.rb +47 -0
  109. data/spec/unit/model/schema_builder_spec.rb +2 -0
  110. data/spec/unit/model/tools_spec.rb +89 -0
  111. data/test/test_upload.rb +39 -15
  112. metadata +98 -75
  113. data/test/test_commands.rb +0 -85
  114. data/test/test_guessing.rb +0 -46
  115. data/test/test_model.rb +0 -81
  116. data/test/test_rest_api_basic.rb +0 -41
@@ -1,9 +1,11 @@
1
- require File.join(File.dirname(__FILE__), "data_result.rb")
1
+ # encoding: UTF-8
2
+
3
+ require_relative 'data_result.rb'
2
4
 
3
5
  module GoodData
4
6
  class ReportDataResult < DataResult
5
-
6
- ROW_LIMIT = 10000000
7
+ # Row limit
8
+ ROW_LIMIT = 10_000_000
7
9
 
8
10
  attr_reader :row_headers, :column_headers, :table, :headers_height, :headers_width
9
11
 
@@ -88,19 +90,19 @@ module GoodData
88
90
  def each_level(table, level, children, lookup)
89
91
  max_level = level + 1
90
92
  children.each do |kid|
91
- first = kid["first"]
92
- last = kid["last"]
93
+ first = kid['first']
94
+ last = kid['last']
93
95
  repetition = last - first + 1
94
96
  repetition.times do |i|
95
97
  table[first + i] ||= []
96
- if kid["type"] == 'total'
97
- table[first + i][level] = kid["id"]
98
+ if kid['type'] == 'total'
99
+ table[first + i][level] = kid['id']
98
100
  else
99
- table[first + i][level] = lookup[level][kid["id"].to_s]
101
+ table[first + i][level] = lookup[level][kid['id'].to_s]
100
102
  end
101
103
  end
102
- if (!kid["children"].empty?)
103
- new_level = each_level(table, level+1, kid["children"], lookup)
104
+ if (!kid['children'].empty?)
105
+ new_level = each_level(table, level+1, kid['children'], lookup)
104
106
  max_level = [max_level, new_level].max
105
107
  end
106
108
  end
@@ -108,29 +110,30 @@ module GoodData
108
110
  end
109
111
 
110
112
  def tabularize_rows
111
- rows = data["xtab_data"]["rows"]
112
- kids = rows["tree"]["children"]
113
+ rows = data['xtab_data']['rows']
114
+ kids = rows['tree']['children']
113
115
 
114
116
  if kids.empty? || (kids.size == 1 && kids.first['type'] == 'metric')
115
117
  headers, size = [[nil]], 0
116
118
  else
117
119
  headers = []
118
- size = each_level(headers, 0, rows["tree"]["children"], rows["lookups"])
120
+ size = each_level(headers, 0, rows['tree']['children'], rows['lookups'])
119
121
  end
120
- return headers, size
122
+ return headers, size # rubocop:disable RedundantReturn
121
123
  end
122
124
 
123
125
  def tabularize_columns
124
- columns = data["xtab_data"]["columns"]
125
- kids = columns["tree"]["children"]
126
+ columns = data['xtab_data']['columns']
127
+ kids = columns['tree']['children']
126
128
 
127
129
  if kids.empty? || (kids.size == 1 && kids.first['type'] == 'metric')
128
130
  headers, size = [[nil]], 0
129
131
  else
130
132
  headers = []
131
- size = each_level(headers, 0, columns["tree"]["children"], columns["lookups"])
133
+ size = each_level(headers, 0, columns['tree']['children'], columns['lookups'])
132
134
  end
133
- return headers, size
135
+
136
+ return headers, size # rubocop:disable RedundantReturn
134
137
  end
135
138
 
136
139
  def assemble_table()
@@ -152,7 +155,7 @@ module GoodData
152
155
  end
153
156
  end
154
157
 
155
- xtab_data = data["xtab_data"]["data"]
158
+ xtab_data = data['xtab_data']['data']
156
159
  # puts "=== DATA === #{column_headers.size}x#{row_headers.size}"
157
160
  (column_headers.size).times do |i|
158
161
  (row_headers.size).times do |j|
@@ -1,40 +1,46 @@
1
- require File.join(File.dirname(__FILE__), "metadata")
1
+ # encoding: UTF-8
2
2
 
3
- module GoodData
4
- class ReportDefinition < GoodData::MdObject
3
+ require_relative 'metadata'
5
4
 
5
+ # GoodData Module
6
+ module GoodData
7
+ # Report Definition
8
+ # TODO: Add more doc ...
9
+ class ReportDefinition < GoodData::MdObject
6
10
  root_key :reportDefinition
7
11
 
8
12
  class << self
9
13
  def [](id)
10
14
  if id == :all
11
- GoodData.get(GoodData.project.md['query'] + '/reportdefinition/')['query']['entries']
12
- else
15
+ uri = GoodData.project.md['query'] + '/reportdefinition/'
16
+ result = GoodData.get(uri)
17
+ result['query']['entries']
18
+ else
13
19
  super
14
20
  end
15
21
  end
16
22
 
17
23
  def create_metrics_part(left, top)
18
24
  stuff = Array(left) + Array(top)
19
- stuff.find_all {|item| item.respond_to?(:is_metric?)}.map do |metric|
25
+ stuff.select { |item| item.respond_to?(:is_metric?) }.map do |metric|
20
26
  create_metric_part(metric)
21
27
  end
22
28
  end
23
29
 
24
30
  def create_metric_part(metric)
25
31
  {
26
- "alias" => metric.title,
27
- "uri" => metric.uri
32
+ 'alias' => metric.title,
33
+ 'uri' => metric.uri
28
34
  }
29
35
  end
30
36
 
31
37
  def create_attribute_part(attrib)
32
38
  {
33
- "attribute" => {
34
- "alias" => "",
35
- "totals" => [],
36
- "uri" => attrib.uri
37
- }
39
+ 'attribute' => {
40
+ 'alias' => '',
41
+ 'totals' => [],
42
+ 'uri' => attrib.uri
43
+ }
38
44
  }
39
45
  end
40
46
 
@@ -48,8 +54,8 @@ module GoodData
48
54
  end
49
55
  memo
50
56
  end
51
- if stuff.any? {|item| item.respond_to?(:is_metric?)}
52
- parts << "metricGroup"
57
+ if stuff.any? { |item| item.respond_to?(:is_metric?) }
58
+ parts << 'metricGroup'
53
59
  end
54
60
  parts
55
61
  end
@@ -62,36 +68,38 @@ module GoodData
62
68
  x = GoodData::MdObject.get_by_id(item)
63
69
  fail "Object given by id \"#{item}\" could not be found" if x.nil?
64
70
  case x.raw_data.keys.first.to_s
65
- when "attribute"
71
+ when 'attribute'
66
72
  GoodData::Attribute.new(x.raw_data).display_forms.first
67
- when "attributeDisplayForm"
73
+ when 'attributeDisplayForm'
68
74
  GoodData::DisplayForm.new(x.raw_data)
69
- when "metric"
75
+ when 'metric'
70
76
  GoodData::Metric.new(x.raw_data)
71
77
  end
72
78
  elsif item.is_a?(Hash) && item.keys.include?(:title)
73
79
  case item[:type].to_s
74
- when "metric"
80
+ when 'metric'
75
81
  GoodData::Metric.find_first_by_title(item[:title])
76
- when "attribute"
77
- GoodData::Attribute.find_first_by_title(item[:title]).display_forms.first
82
+ when 'attribute'
83
+ result = GoodData::Attribute.find_first_by_title(item[:title])
84
+ result.display_forms.first
78
85
  end
79
86
  elsif item.is_a?(Hash) && (item.keys.include?(:id))
80
87
  case item[:type].to_s
81
- when "metric"
88
+ when 'metric'
82
89
  GoodData::Metric.get_by_id(item[:id])
83
- when "attribute"
90
+ when 'attribute'
84
91
  GoodData::Attribute.get_by_id(item[:id]).display_forms.first
85
- when "label"
92
+ when 'label'
86
93
  GoodData::DisplayForm.get_by_id(item[:id])
87
- end
94
+ end
88
95
  elsif item.is_a?(Hash) && (item.keys.include?(:identifier))
89
96
  case item[:type].to_s
90
- when "metric"
97
+ when 'metric'
91
98
  GoodData::Metric.get_by_id(item[:identifier])
92
- when "attribute"
93
- GoodData::Attribute.get_by_id(item[:identifier]).display_forms.first
94
- when "label"
99
+ when 'attribute'
100
+ result = GoodData::Attribute.get_by_id(item[:identifier])
101
+ result.display_forms.first
102
+ when 'label'
95
103
  GoodData::DisplayForm.get_by_id(item[:identifier])
96
104
  end
97
105
  else
@@ -100,91 +108,104 @@ module GoodData
100
108
  end
101
109
  end
102
110
 
103
- def execute(options={})
111
+ def execute(options = {})
104
112
  left = Array(options[:left])
105
113
  top = Array(options[:top])
106
114
 
107
- metrics = (left + top).find_all {|item| item.respond_to?(:is_metric?)}
115
+ metrics = (left + top).select { |item| item.respond_to?(:is_metric?) }
108
116
 
109
- unsaved_metrics = metrics.reject {|i| i.saved?}
110
- unsaved_metrics.each {|m| m.title = "Untitled metric" unless m.title}
117
+ unsaved_metrics = metrics.reject { |i| i.saved? }
118
+ unsaved_metrics.each { |m| m.title = 'Untitled metric' unless m.title }
111
119
 
112
120
  begin
113
- unsaved_metrics.each {|m| m.save}
121
+ unsaved_metrics.each { |m| m.save }
114
122
  rd = GoodData::ReportDefinition.create(options)
115
123
  get_data_result(execute_inline(rd))
116
124
  ensure
117
- unsaved_metrics.each {|m| m.delete if m && m.saved?}
125
+ unsaved_metrics.each { |m| m.delete if m && m.saved? }
118
126
  end
119
127
  end
120
128
 
121
129
  def execute_inline(rd)
122
130
  rd = rd.respond_to?(:raw_data) ? rd.raw_data : rd
123
131
  data = {
124
- :report_req => {
125
- :definitionContent => {
126
- :content => rd,
127
- :projectMetadata => GoodData::project.links["metadata"]}}}
128
- GoodData.post("/gdc/app/projects/#{GoodData.project.pid}/execute", data)
132
+ report_req: {
133
+ definitionContent: {
134
+ content: rd,
135
+ projectMetadata: GoodData.project.links['metadata']
136
+ }
137
+ }
138
+ }
139
+ uri = "/gdc/app/projects/#{GoodData.project.pid}/execute"
140
+ GoodData.post(uri, data)
129
141
  end
130
142
 
131
143
  def get_data_result(result)
132
- data_result_uri = result["execResult"]["dataResult"]
144
+ data_result_uri = result['execResult']['dataResult']
133
145
  result = GoodData.get data_result_uri
134
- while result["taskState"] && result["taskState"]["status"] == "WAIT" do
135
- sleep 10
136
- result = GoodData.get data_result_uri
137
- end
146
+
147
+ while result['taskState'] && result['taskState']['status'] == 'WAIT'
148
+ sleep 10
149
+ result = GoodData.get data_result_uri
150
+ end
151
+
138
152
  ReportDataResult.new(GoodData.get data_result_uri)
139
153
  end
140
154
 
141
- def create(options={})
155
+ def create(options = {})
142
156
  left = Array(options[:left])
143
157
  top = Array(options[:top])
144
158
 
145
159
  left = ReportDefinition.find(left)
146
160
  top = ReportDefinition.find(top)
147
161
 
148
- fail "All metrics in report definition must be saved" unless (left + top).all? {|i| i.saved?}
149
-
150
- ReportDefinition.new({
151
- "reportDefinition" => {
152
- "content" => {
153
- "grid" => {
154
- "sort" => {
155
- "columns" => [],
156
- "rows" => []
157
- },
158
- "columnWidths" => [],
159
- "columns" => ReportDefinition.create_part(top),
160
- "metrics" => ReportDefinition.create_metrics_part(left, top),
161
- "rows" => ReportDefinition.create_part(left),
162
- },
163
- "format" => "grid",
164
- "filters" => []
162
+ # TODO: Put somewhere for i18n
163
+ fail_msg = 'All metrics in report definition must be saved'
164
+ fail fail_msg unless (left + top).all? { |i| i.saved? }
165
+
166
+ pars = {
167
+ 'reportDefinition' => {
168
+ 'content' => {
169
+ 'grid' => {
170
+ 'sort' => {
171
+ 'columns' => [],
172
+ 'rows' => []
173
+ },
174
+ 'columnWidths' => [],
175
+ 'columns' => ReportDefinition.create_part(top),
176
+ 'metrics' => ReportDefinition.create_metrics_part(left, top),
177
+ 'rows' => ReportDefinition.create_part(left)
165
178
  },
166
- "meta" => {
167
- "tags" => "",
168
- "summary" => "",
169
- "title" => "Untitled report definition"
170
- }
171
- }
172
- })
179
+ 'format' => 'grid',
180
+ 'filters' => []
181
+ },
182
+ 'meta' => {
183
+ 'tags' => '',
184
+ 'summary' => '',
185
+ 'title' => 'Untitled report definition'
186
+ }
187
+ }
188
+ }
189
+
190
+ ReportDefinition.new(pars)
173
191
  end
174
192
  end
175
193
 
176
- def metrics
177
- content["grid"]["metrics"].map {|i| GoodData::Metric[i["uri"]]}
194
+ def metrics
195
+ content['grid']['metrics'].map { |i| GoodData::Metric[i['uri']] }
178
196
  end
179
197
 
180
198
  def execute
181
199
  result = if saved?
182
- GoodData.post '/gdc/xtab2/executor', {"report_req" => {"reportDefinition" => uri}}
183
- else
184
- ReportDefinition.execute_inline(self)
185
- end
186
- ReportDefinition::get_data_result(result)
200
+ pars = {
201
+ 'report_req' => { 'reportDefinition' => uri }
202
+ }
203
+ GoodData.post '/gdc/xtab2/executor', pars
204
+ else
205
+ ReportDefinition.execute_inline(self)
206
+ end
207
+
208
+ get_data_result(result)
187
209
  end
188
-
189
- end
190
- end
210
+ end
211
+ end
@@ -1,8 +1,10 @@
1
+ # encoding: UTF-8
2
+
3
+ # GoodData Module
1
4
  module GoodData
2
- VERSION = "0.6.0.pre11"
5
+ VERSION = "0.6.0"
3
6
 
4
7
  class << self
5
-
6
8
  # Version
7
9
  def version
8
10
  VERSION
@@ -10,7 +12,7 @@ module GoodData
10
12
 
11
13
  # Identifier of gem version
12
14
  # @return Formatted gem version
13
- def gem_version_string()
15
+ def gem_version_string
14
16
  "gooddata-gem/#{VERSION}"
15
17
  end
16
18
  end
@@ -1,7 +1,7 @@
1
1
  class MyBrick < GoodData::Bricks::Brick
2
2
 
3
- def call(params)
4
- # do something here
5
- end
3
+ def call(params)
4
+ # do something here
5
+ end
6
6
 
7
7
  end
@@ -1,4 +1,5 @@
1
- require 'gooddata/bricks'
2
- require './mybrick'
1
+ require_relative '../../gooddata/bricks/bricks'
2
+
3
+ require_relative './mybrick'
3
4
 
4
5
  GoodData::Bricks::Pipeline.prepare([LoggerMiddleware, BenchMiddleware, GoodDataMiddleware, MyBrick])
@@ -1,4 +1,4 @@
1
1
  {
2
- "model" : "./model/model.rb",
3
- "project_id" : ""
2
+ "model" : "./model/model.rb",
3
+ "project_id" : ""
4
4
  }
@@ -1,25 +1,25 @@
1
- GoodData::Model::ProjectBuilder.create("<%= name %>") do |p|
2
- p.add_date_dimension("committed_on")
1
+ GoodData::Model::ProjectBuilder.create(" ") do |p|
2
+ p.add_date_dimension("committed_on")
3
3
 
4
- p.add_dataset("repos") do |d|
5
- d.add_anchor("id")
6
- d.add_label("name", :reference => "id")
7
- end
4
+ p.add_dataset("repos") do |d|
5
+ d.add_anchor("id")
6
+ d.add_label("name", :reference => "id")
7
+ end
8
8
 
9
- p.add_dataset("devs") do |d|
10
- d.add_anchor("id")
11
- d.add_label("email", :reference => "id")
12
- end
9
+ p.add_dataset("devs") do |d|
10
+ d.add_anchor("id")
11
+ d.add_label("email", :reference => "id")
12
+ end
13
13
 
14
- p.add_dataset("commits") do |d|
15
- d.add_fact("lines_changed")
16
- d.add_date("committed_on", :dataset => "committed_on")
17
- d.add_reference("dev_id", :dataset => 'devs', :reference => 'id')
18
- d.add_reference("repo_id", :dataset => 'repos', :reference => 'id')
19
- end
14
+ p.add_dataset("commits") do |d|
15
+ d.add_fact("lines_changed")
16
+ d.add_date("committed_on", :dataset => "committed_on")
17
+ d.add_reference("dev_id", :dataset => 'devs', :reference => 'id')
18
+ d.add_reference("repo_id", :dataset => 'repos', :reference => 'id')
19
+ end
20
20
 
21
- p.upload("data/devs.csv", :dataset => 'devs')
22
- p.upload("data/repos.csv", :dataset => 'repos')
23
- p.upload("data/commits.csv", :dataset => 'commits')
21
+ p.upload("data/devs.csv", :dataset => 'devs')
22
+ p.upload("data/repos.csv", :dataset => 'repos')
23
+ p.upload("data/commits.csv", :dataset => 'commits')
24
24
 
25
25
  end