Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cdm timeseries dog-4175 #261

Merged
merged 22 commits into from
Oct 9, 2024
Merged

cdm timeseries dog-4175 #261

merged 22 commits into from
Oct 9, 2024

Conversation

toondaey
Copy link
Contributor

@toondaey toondaey commented Oct 2, 2024

No description provided.

@toondaey toondaey marked this pull request as ready for review October 3, 2024 09:13
@toondaey toondaey requested a review from a team as a code owner October 3, 2024 09:13
@toondaey toondaey changed the title feat: intial impl of cdm timeseries cdm timeseries dog-4175 Oct 3, 2024
/// Id of the instance.
pub id: InstanceId,
/// An audit of the lifecycle of the instance
pub audit: CogniteAuditable,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't appear to use this field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field can't be set by the user technically, because it is meant to give the user information about the lifecycle of the instance.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, is it something generated by FDM?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they are i.e. created_time, last_updated_time and deleted_time.

auto_create_start_nodes: Option<bool>,
auto_create_end_nodes: Option<bool>,
skip_on_version_conflict: Option<bool>,
replace: Option<bool>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, I find that Option<bool> should be avoided. In this case it's better if users just have to pick one, either true or false, leaving it as None as no special semantic meaning beyond "use the default", so if users want to leave them as None they have to look up what that means, which means they might as well just set a value.

Copy link
Collaborator

@einarmo einarmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind this approach, though there are a few methods related to auto-creation of timeseries that we need to figure out somehow if we want to use this in the hosted extractors.

@toondaey
Copy link
Contributor Author

toondaey commented Oct 4, 2024

I don't mind this approach, though there are a few methods related to auto-creation of timeseries that we need to figure out somehow if we want to use this in the hosted extractors.

We should have a discussion on this.

Copy link
Collaborator

@einarmo einarmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to do something about the create-missing methods, but for now this is OK.

let timeseries_del = timeseries_del.items.first().unwrap();
assert!(matches!(timeseries_del, NodeOrEdgeSpecification::Node(_)));

// No need to ensure unit delete because it gets deleted with timeseries apparently.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it gets deleted. But I think you need something special to be able to retrieve it. Specifying the space in the query or something.

Also, I don't think it should be possible to create custom units. A unit should at least have some information about which quantity it is supposed to measure: length, weight, etc. And a conversion factor.

If all you want to test is that you can point to a unit from a time series, could you instead use the cdf_cdm_units/temperature:deg_c unit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sighol I've tried fetching the unit suggested but doesn't seem to exist. Is this a view or container?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to fetch it, you can just set it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@toondaey toondaey merged commit 726e8fa into master Oct 9, 2024
2 checks passed
@toondaey toondaey deleted the cdm-timeseries/dog-4175 branch October 9, 2024 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants