easy_ml 0.2.0.pre.rc39 → 0.2.0.pre.rc41
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/Rakefile +11 -9
- data/app/controllers/easy_ml/application_controller.rb +1 -1
- data/app/frontend/components/dataset/splitters/DateSplitter.tsx +4 -4
- data/app/frontend/components/dataset/splitters/types.ts +3 -3
- data/app/frontend/pages/NewDatasetPage.tsx +1 -1
- data/app/helpers/easy_ml/application_helper.rb +2 -2
- data/app/jobs/easy_ml/compute_feature_job.rb +54 -1
- data/app/models/concerns/easy_ml/dataframe_serialization.rb +30 -0
- data/app/models/easy_ml/dataset.rb +23 -22
- data/app/models/easy_ml/dataset_history.rb +1 -6
- data/app/models/easy_ml/datasources/polars_datasource.rb +4 -18
- data/app/models/easy_ml/event.rb +2 -1
- data/app/models/easy_ml/event_context.rb +58 -0
- data/app/models/easy_ml/feature.rb +40 -11
- data/app/models/easy_ml/model.rb +0 -1
- data/app/models/easy_ml/model_file.rb +7 -3
- data/app/models/easy_ml/splitter_history.rb +16 -0
- data/config/initializers/zhong.rb +4 -0
- data/lib/easy_ml/data/date_converter.rb +1 -0
- data/lib/easy_ml/data/polars_reader.rb +17 -4
- data/lib/easy_ml/data/statistics_learner.rb +1 -1
- data/lib/easy_ml/engine.rb +12 -1
- data/lib/easy_ml/pending_migrations.rb +19 -0
- data/lib/easy_ml/predict.rb +1 -3
- data/lib/easy_ml/railtie/generators/migration/migration_generator.rb +38 -157
- data/lib/easy_ml/railtie/templates/migration/add_workflow_status_to_easy_ml_features.rb.tt +8 -0
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_column_histories.rb.tt +4 -2
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_columns.rb.tt +22 -20
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_dataset_histories.rb.tt +5 -3
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_datasets.rb.tt +26 -24
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_datasource_histories.rb.tt +5 -3
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_datasources.rb.tt +12 -10
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_deploys.rb.tt +21 -19
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_event_contexts.rb.tt +14 -0
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_events.rb.tt +16 -14
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_feature_histories.rb.tt +10 -8
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_features.rb.tt +27 -25
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_model_file_histories.rb.tt +5 -3
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_model_files.rb.tt +13 -11
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_model_histories.rb.tt +5 -3
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_models.rb.tt +28 -26
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_predictions.rb.tt +13 -11
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_retraining_jobs.rb.tt +70 -67
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_settings.rb.tt +6 -4
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_splitter_histories.rb.tt +6 -4
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_splitters.rb.tt +11 -9
- data/lib/easy_ml/railtie/templates/migration/create_easy_ml_tuner_jobs.rb.tt +34 -30
- data/lib/easy_ml/version.rb +1 -1
- data/lib/easy_ml.rb +1 -0
- data/public/easy_ml/assets/.vite/manifest.json +1 -1
- data/public/easy_ml/assets/assets/entrypoints/{Application.tsx-BRRjHz4-.js → Application.tsx-DF5SSkYi.js} +2 -2
- data/public/easy_ml/assets/assets/entrypoints/{Application.tsx-BRRjHz4-.js.map → Application.tsx-DF5SSkYi.js.map} +1 -1
- metadata +9 -18
@@ -196,15 +196,22 @@ module EasyML
|
|
196
196
|
polars_args[:dtypes].merge!(dtypes)
|
197
197
|
end
|
198
198
|
ext = Pathname.new(file).extname.gsub(/\./, "")
|
199
|
+
date_cols = []
|
199
200
|
case ext
|
200
201
|
when "csv"
|
201
|
-
filtered_args = filter_polars_args(Polars.method(:read_csv))
|
202
|
-
filtered_args.merge!(
|
202
|
+
filtered_args, date_cols = filter_polars_args(Polars.method(:read_csv))
|
203
|
+
filtered_args.merge!(
|
204
|
+
infer_schema_length: 1_000_000,
|
205
|
+
null_values: ["\\N", "\\\\N", "NULL"],
|
206
|
+
)
|
203
207
|
df = Polars.read_csv(file, **filtered_args)
|
204
208
|
when "parquet"
|
205
|
-
filtered_args = filter_polars_args(Polars.method(:read_parquet))
|
209
|
+
filtered_args, date_cols = filter_polars_args(Polars.method(:read_parquet))
|
206
210
|
df = Polars.read_parquet(file, **filtered_args)
|
207
211
|
end
|
212
|
+
date_cols.each do |col|
|
213
|
+
df = EasyML::Data::DateConverter.maybe_convert_date(df, col)
|
214
|
+
end
|
208
215
|
df
|
209
216
|
end
|
210
217
|
|
@@ -214,7 +221,13 @@ module EasyML
|
|
214
221
|
|
215
222
|
def filter_polars_args(method)
|
216
223
|
supported_params = method.parameters.map { |_, name| name }
|
217
|
-
polars_args.select { |k, _| supported_params.include?(k) }
|
224
|
+
filtered = polars_args.select { |k, _| supported_params.include?(k) }
|
225
|
+
|
226
|
+
# Filter out any datetime columns, and use maybe_convert_date to convert later
|
227
|
+
date_cols = (filtered[:dtypes] || {}).select { |k, v| v.class == Polars::Datetime }.keys
|
228
|
+
filtered[:dtypes] = (filtered[:dtypes] || {}).reject { |k, v| v.class == Polars::Datetime }
|
229
|
+
filtered = filtered.select { |k, _| supported_params.include?(k) }
|
230
|
+
return filtered, date_cols
|
218
231
|
end
|
219
232
|
|
220
233
|
def csv_files
|
@@ -59,7 +59,7 @@ module EasyML::Data
|
|
59
59
|
stats[col].merge!(most_frequent_value: series.mode.sort.to_a&.first)
|
60
60
|
if field_type == :categorical
|
61
61
|
stats[col].merge!(
|
62
|
-
unique_count: series.n_unique,
|
62
|
+
unique_count: series.cast(:str).n_unique,
|
63
63
|
counts: Hash[series.value_counts.to_hashes.map(&:values)],
|
64
64
|
)
|
65
65
|
end
|
data/lib/easy_ml/engine.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "aws-sdk"
|
2
2
|
require "awesome_print"
|
3
|
+
require "rails/all"
|
3
4
|
require "inertia_rails"
|
4
5
|
require "jsonapi/serializer"
|
5
6
|
require "numo/narray"
|
@@ -68,6 +69,16 @@ module EasyML
|
|
68
69
|
end
|
69
70
|
end
|
70
71
|
|
72
|
+
initializer "easy_ml.check_pending_migrations" do
|
73
|
+
if defined?(Rails::Server)
|
74
|
+
config.after_initialize do
|
75
|
+
if EasyML.pending_migrations?
|
76
|
+
puts "\e[33mWARNING: You have pending EasyML migrations. Run 'rails generate easy_ml:migration' to add them.\e[0m"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
71
82
|
initializer "easy_ml.active_job_config" do
|
72
83
|
resque_initializer = File.expand_path("config/initializers/resque.rb", root)
|
73
84
|
require resque_initializer if File.exist?(resque_initializer)
|
@@ -87,7 +98,7 @@ module EasyML
|
|
87
98
|
end
|
88
99
|
end
|
89
100
|
|
90
|
-
if ENV["
|
101
|
+
if ENV["EASY_ML_DEV"]
|
91
102
|
require "vite_ruby"
|
92
103
|
require "vite_rails"
|
93
104
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module EasyML
|
2
|
+
def self.pending_migrations?
|
3
|
+
return false unless defined?(ActiveRecord)
|
4
|
+
|
5
|
+
# Get all migration files from our templates
|
6
|
+
template_dir = File.expand_path("../railtie/generators/templates/migration", __dir__)
|
7
|
+
template_migrations = Dir.glob(File.join(template_dir, "*.tt")).map do |f|
|
8
|
+
File.basename(f, ".tt").sub(/^create_/, "")
|
9
|
+
end
|
10
|
+
|
11
|
+
# Get all existing migrations
|
12
|
+
existing_migrations = Dir.glob(Rails.root.join("db/migrate/*_*.rb")).map do |f|
|
13
|
+
File.basename(f).sub(/^\d+_create_/, "").sub(/\.rb$/, "")
|
14
|
+
end
|
15
|
+
|
16
|
+
# Check if any template migrations are not in existing migrations
|
17
|
+
(template_migrations - existing_migrations).any?
|
18
|
+
end
|
19
|
+
end
|
data/lib/easy_ml/predict.rb
CHANGED
@@ -23,9 +23,7 @@ module EasyML
|
|
23
23
|
model: current_version.model,
|
24
24
|
model_history: current_version,
|
25
25
|
prediction_type: current_version.model.task,
|
26
|
-
prediction_value:
|
27
|
-
value: preds.first,
|
28
|
-
}.compact,
|
26
|
+
prediction_value: preds.first,
|
29
27
|
raw_input: raw_input,
|
30
28
|
normalized_input: df.to_hashes&.first,
|
31
29
|
)
|
@@ -15,6 +15,32 @@ module EasyML
|
|
15
15
|
# Define the migration name
|
16
16
|
desc "Generates migrations for EasyMLModel"
|
17
17
|
|
18
|
+
# Define the order of migrations
|
19
|
+
MIGRATION_ORDER = %w[
|
20
|
+
create_easy_ml_datasources
|
21
|
+
create_easy_ml_datasets
|
22
|
+
create_easy_ml_columns
|
23
|
+
create_easy_ml_models
|
24
|
+
create_easy_ml_model_files
|
25
|
+
create_easy_ml_tuner_jobs
|
26
|
+
create_easy_ml_retraining_jobs
|
27
|
+
create_easy_ml_settings
|
28
|
+
create_easy_ml_events
|
29
|
+
create_easy_ml_features
|
30
|
+
create_easy_ml_splitters
|
31
|
+
create_easy_ml_splitter_histories
|
32
|
+
create_easy_ml_deploys
|
33
|
+
create_easy_ml_datasource_histories
|
34
|
+
create_easy_ml_dataset_histories
|
35
|
+
create_easy_ml_column_histories
|
36
|
+
create_easy_ml_model_histories
|
37
|
+
create_easy_ml_model_file_histories
|
38
|
+
create_easy_ml_feature_histories
|
39
|
+
create_easy_ml_predictions
|
40
|
+
create_easy_ml_event_contexts
|
41
|
+
add_workflow_status_to_easy_ml_features
|
42
|
+
].freeze
|
43
|
+
|
18
44
|
# Specify the next migration number
|
19
45
|
def self.next_migration_number(dirname)
|
20
46
|
sleep(1)
|
@@ -29,169 +55,24 @@ module EasyML
|
|
29
55
|
|
30
56
|
# Generate the migration files using the templates
|
31
57
|
def create_migration_files
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
create_easy_ml_model_files_migration
|
37
|
-
create_easy_ml_tuner_jobs_migration
|
38
|
-
create_easy_ml_retraining_jobs_migration
|
39
|
-
create_easy_ml_settings_migration
|
40
|
-
create_easy_ml_events_migration
|
41
|
-
create_easy_ml_features_migration
|
42
|
-
create_easy_ml_splitters_migration
|
43
|
-
create_easy_ml_splitter_histories_migration
|
44
|
-
create_easy_ml_deploys
|
58
|
+
# Check for existing migrations first
|
59
|
+
existing_migrations = Dir.glob(Rails.root.join("db/migrate/*_*.rb")).map do |f|
|
60
|
+
File.basename(f).sub(/^\d+_/, "").sub(/\.rb$/, "")
|
61
|
+
end
|
45
62
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
create_easy_ml_feature_histories_migration
|
52
|
-
create_easy_ml_predictions_migration
|
63
|
+
# Create migrations in order if they don't exist
|
64
|
+
MIGRATION_ORDER.each do |migration_name|
|
65
|
+
next if existing_migrations.include?(migration_name)
|
66
|
+
install_migration(migration_name)
|
67
|
+
end
|
53
68
|
end
|
54
69
|
|
55
70
|
private
|
56
71
|
|
57
|
-
|
58
|
-
def create_easy_ml_models_migration
|
59
|
-
migration_template(
|
60
|
-
"create_easy_ml_models.rb.tt",
|
61
|
-
"db/migrate/create_easy_ml_models.rb"
|
62
|
-
)
|
63
|
-
end
|
64
|
-
|
65
|
-
def create_easy_ml_model_files_migration
|
66
|
-
migration_template(
|
67
|
-
"create_easy_ml_model_files.rb.tt",
|
68
|
-
"db/migrate/create_easy_ml_model_files.rb"
|
69
|
-
)
|
70
|
-
end
|
71
|
-
|
72
|
-
def create_easy_ml_datasource_migration
|
73
|
-
migration_template(
|
74
|
-
"create_easy_ml_datasources.rb.tt",
|
75
|
-
"db/migrate/create_easy_ml_datasources.rb"
|
76
|
-
)
|
77
|
-
end
|
78
|
-
|
79
|
-
def create_easy_ml_datasets_migration
|
80
|
-
migration_template(
|
81
|
-
"create_easy_ml_datasets.rb.tt",
|
82
|
-
"db/migrate/create_easy_ml_datasets.rb"
|
83
|
-
)
|
84
|
-
end
|
85
|
-
|
86
|
-
def create_easy_ml_tuner_jobs_migration
|
87
|
-
migration_template(
|
88
|
-
"create_easy_ml_tuner_jobs.rb.tt",
|
89
|
-
"db/migrate/create_easy_ml_tuner_jobs.rb"
|
90
|
-
)
|
91
|
-
end
|
92
|
-
|
93
|
-
def create_easy_ml_retraining_jobs_migration
|
94
|
-
migration_template(
|
95
|
-
"create_easy_ml_retraining_jobs.rb.tt",
|
96
|
-
"db/migrate/create_easy_ml_retraining_jobs.rb"
|
97
|
-
)
|
98
|
-
end
|
99
|
-
|
100
|
-
def create_easy_ml_settings_migration
|
101
|
-
migration_template(
|
102
|
-
"create_easy_ml_settings.rb.tt",
|
103
|
-
"db/migrate/create_easy_ml_settings.rb"
|
104
|
-
)
|
105
|
-
end
|
106
|
-
|
107
|
-
def create_easy_ml_events_migration
|
108
|
-
migration_template(
|
109
|
-
"create_easy_ml_events.rb.tt",
|
110
|
-
"db/migrate/create_easy_ml_events.rb"
|
111
|
-
)
|
112
|
-
end
|
113
|
-
|
114
|
-
def create_easy_ml_columns_migration
|
115
|
-
migration_template(
|
116
|
-
"create_easy_ml_columns.rb.tt",
|
117
|
-
"db/migrate/create_easy_ml_columns.rb"
|
118
|
-
)
|
119
|
-
end
|
120
|
-
|
121
|
-
def create_easy_ml_features_migration
|
122
|
-
migration_template(
|
123
|
-
"create_easy_ml_features.rb.tt",
|
124
|
-
"db/migrate/create_easy_ml_features.rb"
|
125
|
-
)
|
126
|
-
end
|
127
|
-
|
128
|
-
def create_easy_ml_splitters_migration
|
129
|
-
migration_template(
|
130
|
-
"create_easy_ml_splitters.rb.tt",
|
131
|
-
"db/migrate/create_easy_ml_splitters.rb"
|
132
|
-
)
|
133
|
-
end
|
134
|
-
|
135
|
-
def create_easy_ml_splitter_histories_migration
|
136
|
-
migration_template(
|
137
|
-
"create_easy_ml_splitter_histories.rb.tt",
|
138
|
-
"db/migrate/create_easy_ml_splitter_histories.rb"
|
139
|
-
)
|
140
|
-
end
|
141
|
-
|
142
|
-
def create_easy_ml_datasource_histories_migration
|
143
|
-
migration_template(
|
144
|
-
"create_easy_ml_datasource_histories.rb.tt",
|
145
|
-
"db/migrate/create_easy_ml_datasource_histories.rb"
|
146
|
-
)
|
147
|
-
end
|
148
|
-
|
149
|
-
def create_easy_ml_dataset_histories_migration
|
150
|
-
migration_template(
|
151
|
-
"create_easy_ml_dataset_histories.rb.tt",
|
152
|
-
"db/migrate/create_easy_ml_dataset_histories.rb"
|
153
|
-
)
|
154
|
-
end
|
155
|
-
|
156
|
-
def create_easy_ml_column_histories_migration
|
157
|
-
migration_template(
|
158
|
-
"create_easy_ml_column_histories.rb.tt",
|
159
|
-
"db/migrate/create_easy_ml_column_histories.rb"
|
160
|
-
)
|
161
|
-
end
|
162
|
-
|
163
|
-
def create_easy_ml_model_histories_migration
|
164
|
-
migration_template(
|
165
|
-
"create_easy_ml_model_histories.rb.tt",
|
166
|
-
"db/migrate/create_easy_ml_model_histories.rb"
|
167
|
-
)
|
168
|
-
end
|
169
|
-
|
170
|
-
def create_easy_ml_feature_histories_migration
|
171
|
-
migration_template(
|
172
|
-
"create_easy_ml_feature_histories.rb.tt",
|
173
|
-
"db/migrate/create_easy_ml_feature_histories.rb"
|
174
|
-
)
|
175
|
-
end
|
176
|
-
|
177
|
-
def create_easy_ml_model_file_histories_migration
|
178
|
-
migration_template(
|
179
|
-
"create_easy_ml_model_file_histories.rb.tt",
|
180
|
-
"db/migrate/create_easy_ml_model_file_histories.rb"
|
181
|
-
)
|
182
|
-
end
|
183
|
-
|
184
|
-
def create_easy_ml_deploys
|
185
|
-
migration_template(
|
186
|
-
"create_easy_ml_deploys.rb.tt",
|
187
|
-
"db/migrate/create_easy_ml_deploys.rb"
|
188
|
-
)
|
189
|
-
end
|
190
|
-
|
191
|
-
def create_easy_ml_predictions_migration
|
72
|
+
def install_migration(migration_name)
|
192
73
|
migration_template(
|
193
|
-
"
|
194
|
-
"db/migrate
|
74
|
+
"#{migration_name}.rb.tt",
|
75
|
+
"db/migrate/#{migration_name}.rb"
|
195
76
|
)
|
196
77
|
end
|
197
78
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class AddWorkflowStatusToEasyMLFeatures < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
2
|
+
def change
|
3
|
+
unless column_exists?(:easy_ml_features, :workflow_status)
|
4
|
+
add_column :easy_ml_features, :workflow_status, :string
|
5
|
+
add_index :easy_ml_features, :workflow_status
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
@@ -2,8 +2,10 @@ require "historiographer/postgres_migration"
|
|
2
2
|
|
3
3
|
class CreateEasyMLColumnHistories < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
4
4
|
def change
|
5
|
-
|
6
|
-
|
5
|
+
unless table_exists?(:easy_ml_column_histories)
|
6
|
+
create_table :easy_ml_column_histories do |t|
|
7
|
+
t.histories(foreign_key: :column_id)
|
8
|
+
end
|
7
9
|
end
|
8
10
|
end
|
9
11
|
end
|
@@ -1,25 +1,27 @@
|
|
1
1
|
class CreateEasyMLColumns < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
3
|
+
unless table_exists?(:easy_ml_columns)
|
4
|
+
create_table :easy_ml_columns do |t|
|
5
|
+
t.bigint :dataset_id, null: false
|
6
|
+
t.string :name, null: false
|
7
|
+
t.string :description
|
8
|
+
t.string :datatype # The symbol representation (e.g., 'float', 'integer')
|
9
|
+
t.string :polars_datatype # The full Polars class name (e.g., 'Polars::Float64')
|
10
|
+
t.boolean :is_target
|
11
|
+
t.boolean :hidden, default: false
|
12
|
+
t.boolean :drop_if_null, default: false
|
13
|
+
t.json :preprocessing_steps
|
14
|
+
t.json :sample_values # Store up to 3 sample values
|
15
|
+
t.json :statistics
|
15
16
|
|
16
|
-
|
17
|
+
t.timestamps
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
t.index [:dataset_id, :name], unique: true
|
20
|
+
t.index :datatype
|
21
|
+
t.index :hidden
|
22
|
+
t.index :drop_if_null
|
23
|
+
t.index :is_target
|
24
|
+
end
|
23
25
|
end
|
24
|
-
end
|
25
|
-
end
|
26
|
+
end
|
27
|
+
end
|
@@ -2,8 +2,10 @@ require "historiographer/postgres_migration"
|
|
2
2
|
|
3
3
|
class CreateEasyMLDatasetHistories < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
4
4
|
def change
|
5
|
-
|
6
|
-
|
5
|
+
unless table_exists?(:easy_ml_dataset_histories)
|
6
|
+
create_table :easy_ml_dataset_histories do |t|
|
7
|
+
t.histories(foreign_key: :dataset_id)
|
8
|
+
end
|
7
9
|
end
|
8
10
|
end
|
9
|
-
end
|
11
|
+
end
|
@@ -1,31 +1,33 @@
|
|
1
1
|
class CreateEasyMLDatasets < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
3
|
+
unless table_exists?(:easy_ml_datasets)
|
4
|
+
create_table :easy_ml_datasets do |t|
|
5
|
+
t.string :name, null: false
|
6
|
+
t.string :description
|
7
|
+
t.string :dataset_type
|
8
|
+
t.string :status
|
9
|
+
t.string :version
|
10
|
+
t.bigint :datasource_id
|
11
|
+
t.string :root_dir
|
12
|
+
t.json :configuration
|
13
|
+
t.bigint :num_rows
|
14
|
+
t.string :workflow_status
|
15
|
+
t.json :statistics
|
16
|
+
t.json :preprocessor_statistics
|
17
|
+
t.json :schema
|
18
|
+
t.datetime :refreshed_at
|
18
19
|
|
19
|
-
|
20
|
+
t.timestamps
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
t.index :created_at
|
23
|
+
t.index :refreshed_at
|
24
|
+
t.index :name
|
25
|
+
t.index :status
|
26
|
+
t.index [:name, :status]
|
27
|
+
t.index :datasource_id
|
28
|
+
t.index :dataset_type
|
29
|
+
t.index :workflow_status
|
30
|
+
end
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
@@ -2,8 +2,10 @@ require "historiographer/postgres_migration"
|
|
2
2
|
|
3
3
|
class CreateEasyMLDatasourceHistories < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
4
4
|
def change
|
5
|
-
|
6
|
-
|
5
|
+
unless table_exists?(:easy_ml_datasource_histories)
|
6
|
+
create_table :easy_ml_datasource_histories do |t|
|
7
|
+
t.histories(foreign_key: :datasource_id)
|
8
|
+
end
|
7
9
|
end
|
8
10
|
end
|
9
|
-
end
|
11
|
+
end
|
@@ -1,16 +1,18 @@
|
|
1
1
|
class CreateEasyMLDatasources < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
unless table_exists?(:easy_ml_datasources)
|
4
|
+
create_table :easy_ml_datasources do |t|
|
5
|
+
t.string :name, null: false
|
6
|
+
t.string :datasource_type
|
7
|
+
t.string :root_dir
|
8
|
+
t.json :configuration
|
9
|
+
t.datetime :refreshed_at
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
t.timestamps
|
12
|
+
t.index :created_at
|
13
|
+
t.index :datasource_type
|
14
|
+
t.index :refreshed_at
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -1,24 +1,26 @@
|
|
1
1
|
class CreateEasyMLDeploys < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
3
|
+
unless table_exists?(:easy_ml_deploys)
|
4
|
+
create_table :easy_ml_deploys do |t|
|
5
|
+
t.bigint :model_id
|
6
|
+
t.bigint :model_history_id
|
7
|
+
t.bigint :retraining_run_id
|
8
|
+
t.bigint :model_file_id
|
9
|
+
t.string :status, null: false
|
10
|
+
t.string :trigger, default: 'manual'
|
11
|
+
t.text :stacktrace
|
12
|
+
t.string :snapshot_id
|
13
|
+
t.timestamps
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
t.index :created_at
|
16
|
+
t.index :model_id
|
17
|
+
t.index :model_history_id
|
18
|
+
t.index :snapshot_id
|
19
|
+
t.index :model_file_id
|
20
|
+
t.index :retraining_run_id
|
21
|
+
t.index :status
|
22
|
+
t.index :trigger
|
23
|
+
end
|
22
24
|
end
|
23
25
|
end
|
24
|
-
end
|
26
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateEasyMLEventContexts < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
2
|
+
def change
|
3
|
+
unless table_exists?(:easy_ml_event_contexts)
|
4
|
+
create_table :easy_ml_event_contexts do |t|
|
5
|
+
t.references :event, null: false, foreign_key: { to_table: :easy_ml_events }
|
6
|
+
t.jsonb :context, null: false, default: {}
|
7
|
+
t.string :format
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
|
11
|
+
add_index :easy_ml_event_contexts, :context, using: :gin
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,20 +1,22 @@
|
|
1
1
|
class CreateEasyMLEvents < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
unless table_exists?(:easy_ml_events)
|
4
|
+
create_table :easy_ml_events do |t|
|
5
|
+
t.string :name, null: false
|
6
|
+
t.string :status, null: false
|
7
|
+
t.string :eventable_type
|
8
|
+
t.bigint :eventable_id
|
9
|
+
t.text :stacktrace
|
9
10
|
|
10
|
-
|
11
|
+
t.timestamps
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
t.index :name
|
14
|
+
t.index :status
|
15
|
+
t.index :eventable_type
|
16
|
+
t.index :eventable_id
|
17
|
+
t.index :created_at
|
18
|
+
t.index [:eventable_type, :eventable_id]
|
19
|
+
end
|
18
20
|
end
|
19
21
|
end
|
20
|
-
end
|
22
|
+
end
|
@@ -2,13 +2,15 @@ require "historiographer/postgres_migration"
|
|
2
2
|
|
3
3
|
class CreateEasyMLFeatureHistories < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
4
4
|
def change
|
5
|
-
|
6
|
-
t
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
unless table_exists?(:easy_ml_feature_histories)
|
6
|
+
create_table :easy_ml_feature_histories do |t|
|
7
|
+
t.histories(
|
8
|
+
foreign_key: :feature_id,
|
9
|
+
index_names: {
|
10
|
+
[:dataset_id, :feature_position] => "idx_feature_histories_on_dataset_and_position"
|
11
|
+
}
|
12
|
+
)
|
13
|
+
end
|
12
14
|
end
|
13
15
|
end
|
14
|
-
end
|
16
|
+
end
|