question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

More specification for behaviour of target_datetime

See original GitHub issue

Hi,

I was thinking about implementing target_datetime in some of the parsers, and came up with the following questions. If you let me know what you prefer, I can update comments in example parser and README to match 👍

  • What is expected behaviour if target_datetime doesn’t exactly match available data?
    • example: 18:45 is requested, but data is only available in hourly segments. Return closest data point (19:00) or return None? I see that ENTSOE parser has closest_in_time_key logic that would do the former - should that be the guideline?
    • example: 18:30 is requested, but data is only available in hourly segments. Round up or down, or return None when ambiguous?
  • What is expected behaviour when the parser can get some historical data, but not necessarily all? Examples: there might be data for only 2018 and not 2017; or there is data for 2018-03-01 and 2018-03-03 but 2018-03-02 is missing.
    • return empty dict, or empty list?
    • return None?
    • raise NotImplementedException?
  • Is it worth implementing target_datetime if max time in the past is within 24 hours, or is it sufficient to return 24 hours’ worth of history when invoked without a target_datetime parameter?
  • ENTSOE parser’s fetch_exchange always returns a list, even when returning one datapoint via target_datetime parameter. Is this required, or is it fine to return a list normally but a dict when called with target_datetime?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jarekcommented, Mar 20, 2018

This looks fine now after #1237, I’ll close it. Thanks!

1reaction
jarekcommented, Mar 13, 2018

Okay, thanks!

To try to summarize:

  • parsers can return as much data as feasible, provided it is close to target_datetime, with guideline being the amount of data returned in one HTTP request by source API
  • timestamp datapoints correctly as indicated by source API
  • don’t worry too much about how close is close enough, as backend will reject datapoints it doesn’t like
  • when no matching data is available, return None

I think that makes sense - certainly it does for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is a Target-Date Fund? Risk Tolerance and Example
A target-date fund is a fund offered by an investment company that seeks to grow assets over a specified period of time for...
Read more >
Action, actor, context, target, time (AACTT): a framework for ...
We propose to expand the TACT framework to guide specification of behaviour in terms of not only Target, Action, Context and Time but...
Read more >
Target Date Retirement Fund Names and Marketing - SEC.gov
Target date funds have become more prevalent in 401(k) plans as a result of the designation of these funds as a qualified default...
Read more >
Save the Date: Target-Date Funds Explained | FINRA.org
You pick a fund with a target year that is closest to the year you anticipate retiring, say a "2050 Fund." The closer...
Read more >
The effect of default target date funds on retirement savings ...
Defined contribution retirement plans increasingly use target date funds as the plan investment default with the intent of simplifying participant choices.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found