Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
TS.INFO is not obsolete
  • Loading branch information
mgravell committed Aug 24, 2026
commit 3b3e0369e36db793097b60a49013228e5ba18a9a
1 change: 0 additions & 1 deletion src/NRedisStack/ResponseParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ public static TdigestInformation
mergedWeight, unmergedWeight, observations, totalCompressions, memoryUsage);
}

[Obsolete]
public static TimeSeriesInformation ToTimeSeriesInfo(this RedisResult result)
{
long totalSamples = -1, memoryUsage = -1, retentionTime = -1, chunkSize = -1, chunkCount = -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public class TimeSeriesInformation
/// </summary>
public IReadOnlyList<TimeSeriesChunck>? Chunks { get; private set; }

[Obsolete]
internal TimeSeriesInformation(long totalSamples, long memoryUsage,
TimeStamp? firstTimeStamp, TimeStamp? lastTimeStamp, long retentionTime,
long chunkCount, long chunkSize, IReadOnlyList<TimeSeriesLabel>? labels,
Expand All @@ -97,7 +96,9 @@ internal TimeSeriesInformation(long totalSamples, long memoryUsage,
SourceKey = sourceKey;
Rules = rules;
// backwards compatible with RedisTimeSeries < v1.4
#pragma warning disable CS0618 // MaxSamplesPerChunk is deprecated, but we still need to populate it
MaxSamplesPerChunk = chunkSize / 16;
#pragma warning restore CS0618
ChunkSize = chunkSize;
// configure what to do on duplicate sample > v1.4
DuplicatePolicy = policy;
Expand Down
1 change: 0 additions & 1 deletion src/NRedisStack/TimeSeries/TimeSeriesCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ public IReadOnlyList<TimeSeriesTuple> RevRange(string key,
#region General

/// <inheritdoc/>
[Obsolete]
public TimeSeriesInformation Info(string key, bool debug = false)
{
return _db.Execute(TimeSeriesCommandsBuilder.Info(key, debug)).ToTimeSeriesInfo();
Expand Down
1 change: 0 additions & 1 deletion src/NRedisStack/TimeSeries/TimeSeriesCommandsAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ public async Task<IReadOnlyList<TimeSeriesTuple>> RevRangeAsync(string key,
#region General

/// <inheritdoc/>
[Obsolete]
public async Task<TimeSeriesInformation> InfoAsync(string key, bool debug = false)
{
return (await _db.ExecuteAsync(TimeSeriesCommandsBuilder.Info(key, debug))).ToTimeSeriesInfo();
Expand Down
1 change: 0 additions & 1 deletion tests/NRedisStack.Tests/PipelineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ public void TestJsonPipeline(string endpointId)

[Theory]
[MemberData(nameof(EndpointsFixture.Env.StandaloneOnly), MemberType = typeof(EndpointsFixture.Env))]
[Obsolete]
public async Task Issue401_TestPipelineAsInitialCommand(string endpointId)
{
IDatabase db = GetCleanDatabase(endpointId);
Expand Down
32 changes: 32 additions & 0 deletions tests/NRedisStack.Tests/TimeSeries/TestAPI/InfoNotObsoleteGuard.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using NRedisStack.RedisStackCommands;
using StackExchange.Redis;

namespace NRedisStack.Tests.TimeSeries.TestAPI;

// COMPILE-TIME test - deliberately NOT an xUnit [Fact]/[Theory], and never executed (no server, no
// assertions). The check is performed entirely by the compiler, so this file must never be given a
// file-level obsolete-suppression pragma.
//
// Why it exists: TS.INFO is not deprecated, but Info/InfoAsync on the concrete command types carried a
// bare [Obsolete] from #184 (v0.10.0) until #548. Nothing about the command was deprecated; the attribute
// was added to silence CS0618 raised inside TimeSeriesInformation's constructor, which still has to
// populate the genuinely-deprecated MaxSamplesPerChunk, and it then cascaded outwards through
// ToTimeSeriesInfo to the public API. The interfaces were never marked, so the warning only hit callers
// going through db.TS() - which is to say, essentially everyone.
//
// This project compiles CS0612/CS0618 as errors (see NRedisStack.Tests.csproj), so if any of these ever
// becomes obsolete again, this file fails to BUILD. That build failure IS the test.
internal static class InfoNotObsoleteGuard
{
public static void SyncInterface(ITimeSeriesCommands ts) => _ = ts.Info("k").ChunkSize;

public static Task AsyncInterface(ITimeSeriesCommandsAsync ts) => ts.InfoAsync("k");

public static void Concrete(IDatabase db)
{
// db.TS() returns the concrete TimeSeriesCommands - the dominant real-world call pattern, and the
// one that actually produced the warning reported in #548.
_ = db.TS().Info("k").ChunkSize;
_ = db.TS().InfoAsync("k");
}
}
7 changes: 0 additions & 7 deletions tests/NRedisStack.Tests/TimeSeries/TestAPI/TestAdd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class TestAdd(EndpointsFixture endpointsFixture) : AbstractNRedisStackTes


[Fact]
[Obsolete]
public void TestAddNotExistingTimeSeries()
{
IDatabase db = GetCleanDatabase();
Expand All @@ -26,7 +25,6 @@ public void TestAddNotExistingTimeSeries()
}

[Fact]
[Obsolete]
public void TestAddExistingTimeSeries()
{
IDatabase db = GetCleanDatabase();
Expand All @@ -41,7 +39,6 @@ public void TestAddExistingTimeSeries()
}

[Fact]
[Obsolete]
public void TestAddStar()
{
IDatabase db = GetCleanDatabase();
Expand All @@ -54,7 +51,6 @@ public void TestAddStar()
}

[Fact]
[Obsolete]
public void TestAddWithRetentionTime()
{
IDatabase db = GetCleanDatabase();
Expand All @@ -69,7 +65,6 @@ public void TestAddWithRetentionTime()
}

[Fact]
[Obsolete]
public void TestAddWithLabels()
{
IDatabase db = GetCleanDatabase();
Expand All @@ -85,7 +80,6 @@ public void TestAddWithLabels()
}

[Fact]
[Obsolete]
public void TestAddWithUncompressed()
{
IDatabase db = GetCleanDatabase();
Expand All @@ -99,7 +93,6 @@ public void TestAddWithUncompressed()
}

[Fact]
[Obsolete]
public void TestAddWithChunkSize()
{
IDatabase db = GetCleanDatabase();
Expand Down
7 changes: 0 additions & 7 deletions tests/NRedisStack.Tests/TimeSeries/TestAPI/TestAddAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace NRedisStack.Tests.TimeSeries.TestAPI;
public class TestAddAsync(EndpointsFixture endpointsFixture) : AbstractNRedisStackTest(endpointsFixture)
{
[Fact]
[Obsolete]
public async Task TestAddNotExistingTimeSeries()
{
var key = CreateKeyName();
Expand All @@ -25,7 +24,6 @@ public async Task TestAddNotExistingTimeSeries()
}

[Fact]
[Obsolete]
public async Task TestAddExistingTimeSeries()
{
var key = CreateKeyName();
Expand All @@ -41,7 +39,6 @@ public async Task TestAddExistingTimeSeries()
}

[Fact]
[Obsolete]
public async Task TestAddStar()
{
var key = CreateKeyName();
Expand All @@ -54,7 +51,6 @@ public async Task TestAddStar()
}

[Fact]
[Obsolete]
public async Task TestAddWithRetentionTime()
{
var key = CreateKeyName();
Expand All @@ -71,7 +67,6 @@ public async Task TestAddWithRetentionTime()
}

[Fact]
[Obsolete]
public async Task TestAddWithLabels()
{
var key = CreateKeyName();
Expand All @@ -89,7 +84,6 @@ public async Task TestAddWithLabels()
}

[Fact]
[Obsolete]
public async Task TestAddWithChunkSize()
{
var key = CreateKeyName();
Expand All @@ -104,7 +98,6 @@ public async Task TestAddWithChunkSize()
}

[Fact]
[Obsolete]
public async Task TestAddWithUncompressed()
{
var key = CreateKeyName();
Expand Down
4 changes: 0 additions & 4 deletions tests/NRedisStack.Tests/TimeSeries/TestAPI/TestCreate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public class TestCreate(EndpointsFixture endpointsFixture) : AbstractNRedisStack


[Fact]
[Obsolete]
public void TestCreateOK()
{
IDatabase db = GetCleanDatabase();
Expand All @@ -23,7 +22,6 @@ public void TestCreateOK()
}

[Fact]
[Obsolete]
public void TestCreateRetentionTime()
{
long retentionTime = 5000;
Expand All @@ -35,7 +33,6 @@ public void TestCreateRetentionTime()
}

[Fact]
[Obsolete]
public void TestCreateLabels()
{
TimeSeriesLabel label = new("key", "value");
Expand All @@ -48,7 +45,6 @@ public void TestCreateLabels()
}

[Fact]
[Obsolete]
public void TestCreateEmptyLabels()
{
var labels = new List<TimeSeriesLabel>();
Expand Down
3 changes: 0 additions & 3 deletions tests/NRedisStack.Tests/TimeSeries/TestAPI/TestCreateAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public async Task TestCreateOK()
}

[Fact]
[Obsolete]
public async Task TestCreateRetentionTime()
{
var key = CreateKeyName();
Expand All @@ -32,7 +31,6 @@ public async Task TestCreateRetentionTime()
}

[Fact]
[Obsolete]
public async Task TestCreateLabels()
{
var key = CreateKeyName();
Expand All @@ -47,7 +45,6 @@ public async Task TestCreateLabels()
}

[Fact]
[Obsolete]
public async Task TestCreateEmptyLabels()
{
var key = CreateKeyName();
Expand Down
2 changes: 0 additions & 2 deletions tests/NRedisStack.Tests/TimeSeries/TestAPI/TestDecrBy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public void TestDecrByTimeStamp()
}

[Fact]
[Obsolete]
public void TestDefaultDecrByWithRetentionTime()
{
double value = 5.5;
Expand All @@ -57,7 +56,6 @@ public void TestDefaultDecrByWithRetentionTime()
}

[Fact]
[Obsolete]
public void TestDefaultDecrByWithLabels()
{
double value = 5.5;
Expand Down
2 changes: 0 additions & 2 deletions tests/NRedisStack.Tests/TimeSeries/TestAPI/TestDecrByAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public async Task TestDecrByTimeStamp()
}

[Fact]
[Obsolete]
public async Task TestDefaultDecrByWithRetentionTime()
{
var key = CreateKeyName();
Expand All @@ -64,7 +63,6 @@ public async Task TestDefaultDecrByWithRetentionTime()
}

[Fact]
[Obsolete]
public async Task TestDefaultDecrByWithLabels()
{
var key = CreateKeyName();
Expand Down
2 changes: 0 additions & 2 deletions tests/NRedisStack.Tests/TimeSeries/TestAPI/TestIncrBy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public void TestIncrByTimeStamp()
}

[Fact]
[Obsolete]
public void TestDefaultIncrByWithRetentionTime()
{
double value = 5.5;
Expand All @@ -56,7 +55,6 @@ public void TestDefaultIncrByWithRetentionTime()
}

[Fact]
[Obsolete]
public void TestDefaultIncrByWithLabels()
{
double value = 5.5;
Expand Down
2 changes: 0 additions & 2 deletions tests/NRedisStack.Tests/TimeSeries/TestAPI/TestIncrByAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public async Task TestIncrByTimeStamp()
}

[Fact]
[Obsolete]
public async Task TestDefaultIncrByWithRetentionTime()
{
var key = CreateKeyName();
Expand All @@ -64,7 +63,6 @@ public async Task TestDefaultIncrByWithRetentionTime()
}

[Fact]
[Obsolete]
public async Task TestDefaultIncrByWithLabels()
{
var key = CreateKeyName();
Expand Down
1 change: 0 additions & 1 deletion tests/NRedisStack.Tests/TimeSeries/TestAPI/TestMADD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class TestMADD(EndpointsFixture endpointsFixture) : AbstractNRedisStackTe

[SkipIfRedisTheory(Is.Enterprise)]
[MemberData(nameof(EndpointsFixture.Env.AllEnvironments), MemberType = typeof(EndpointsFixture.Env))]
[Obsolete]
public void TestStarMADD(string endpointId)
{
SkipClusterPre8(endpointId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class TestMAddAsync(EndpointsFixture endpointsFixture) : AbstractNRedisSt
{
[SkipIfRedisTheory(Is.Enterprise)]
[MemberData(nameof(EndpointsFixture.Env.AllEnvironments), MemberType = typeof(EndpointsFixture.Env))]
[Obsolete]
public async Task TestStarMADD(string endpointId)
{
SkipClusterPre8(endpointId);
Expand Down
1 change: 0 additions & 1 deletion tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRead.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#pragma warning disable CS0618, CS0612 // allow testing obsolete methods
using NRedisStack.DataTypes;
using NRedisStack.RedisStackCommands;
using Xunit;
Expand Down
1 change: 0 additions & 1 deletion tests/NRedisStack.Tests/TimeSeries/TestAPI/TestRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class TestRules(EndpointsFixture endpointsFixture) : AbstractNRedisStackT

[SkipIfRedisTheory(Is.Enterprise)]
[MemberData(nameof(EndpointsFixture.Env.AllEnvironments), MemberType = typeof(EndpointsFixture.Env))]
[Obsolete]
public void TestRulesAdditionDeletion(string endpointId)
{
SkipClusterPre8(endpointId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class TestRulesAsync(EndpointsFixture endpointsFixture) : AbstractNRedisS
{
[SkipIfRedisTheory(Is.Enterprise)]
[MemberData(nameof(EndpointsFixture.Env.AllEnvironments), MemberType = typeof(EndpointsFixture.Env))]
[Obsolete]
public async Task TestRulesAdditionDeletion(string endpointId)
{
SkipClusterPre8(endpointId);
Expand Down