Skip to content

Commit

Permalink
Fix "missing body in POST request"
Browse files Browse the repository at this point in the history
Happened if InsertDataPointsIgnoreErrors was called and all timeseries
were invalid. CDF would return an error if there were no
timeseries/datapoints in the request.
  • Loading branch information
einarmo committed Jul 6, 2020
1 parent 2506e92 commit b935968
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ExtractorUtils/Cognite/DatapointExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ private static async Task InsertDataPointsChunk(
IEnumerable<(Identity id, IEnumerable<Datapoint> dataPoints)> points,
CancellationToken token)
{
if (!points.Any()) return;
var request = new DataPointInsertionRequest();
var dataPointCount = 0;
foreach (var entry in points)
Expand Down Expand Up @@ -238,6 +239,7 @@ private static async Task<InsertError> InsertDataPointsIgnoreErrorsChunk(
IEnumerable<(Identity id, IEnumerable<Datapoint> dataPoints)> points,
CancellationToken token)
{
if (!points.Any()) return new InsertError(Enumerable.Empty<Identity>(), Enumerable.Empty<Identity>());
var comparer = new IdentityComparer();
var missing = new HashSet<Identity>(comparer);
var mismatched = new HashSet<Identity>(comparer);
Expand Down

0 comments on commit b935968

Please sign in to comment.