Sha256: 67b5296f4c02f9658b7ea196f4857b94fbcfff0b9c684f2226d7d140b9b526cf
Contents?: true
Size: 944 Bytes
Versions: 27
Compression:
Stored size: 944 Bytes
Contents
require "jsonapi/serializer" module EasyML class RetrainingRunSerializer include JSONAPI::Serializer attributes :id, :deployable, :metrics, :metric_value, :threshold, :threshold_direction, :status, :error_message, :is_deploying, :deployed attribute :metrics_url do |run| run.wandb_url end attribute :started_at do |run| run.started_at&.in_time_zone(EasyML::Configuration.timezone) end attribute :completed_at do |run| run.completed_at&.in_time_zone(EasyML::Configuration.timezone) end attribute :stacktrace do |object| if object.status.to_s == "running" nil else last_event = object.events.order(id: :desc).limit(1).last last_event&.stacktrace if last_event&.status.to_s == "failed" end end end end
Version data entries
27 entries across 27 versions & 1 rubygems