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

Add support for reading raw data #19

Merged
merged 10 commits into from
Aug 17, 2020
Merged

Add support for reading raw data #19

merged 10 commits into from
Aug 17, 2020

Conversation

einarsi
Copy link
Collaborator

@einarsi einarsi commented Aug 17, 2020

Added support for ReaderType.RAW for all handlers.

Rewrote tag reading mechanism by moving responsibility for limiting amount of data points returned from client to handler. Client now investigates length of returned result to determine start time of next query, instead of querying predetermined fixed-length intervals. This makes a more unified read algorithm for fixed-length intervals (such as INT) and uneven time series (such as RAW).

Reduced max rows per query from PI Web API to default value 10000.

Warn instead of crash when user tries to read an invalid tag.

Minor corrections to manual and to setup.py long description.
Try to correct weird bug in PI Web API where read-type MAX timestamps end
of interval while all the other summaries stamp  start of interval by
shifting all timestamps one interval down.
PI Web API returns timestamps with sub-second part for RAW, otherwise
without. pd.to_datetime() crashes if format is specified wrong, so
make sure both cases are handled.
Different cases result in timezone naive or aware stamps, so ensure
all are aware by specifying utc=True during conversion.
Slicing as used for INT and aggregated values doesn't work for
reads with indeterminate lengths. Therefore moving enforcing of length
for RAW into handler and changing client logic to investigate length
of returned results to determine whether done or not.
Should probably use similar solution for all read types, not just RAW.
Previous algorithm:
Client identifies stop time for next query based on absolute stop
time and max query length. Client expect handler to return exactly
what is asked for.
This works fine for fixed-interval time series, but not for uneven time
series such as RAW.

New algorithm:
Client asks handler for all missing data. Handler ensures response is
limited by max query length, and may return less data than what the
client asked for. Upon receiving new data, the client identifies what
data is still missing.
This works fine for both fixed-interval and uneven time series.

Also improved warning when tags are invalid and added tests.
@einarsi einarsi merged commit a6e79c1 into master Aug 17, 2020
@einarsi einarsi deleted the uneven-time-series branch August 17, 2020 10:39
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.

1 participant