Skip to content

Commit 3d38ebc

Browse files
codebrainrusscam
authored andcommitted
Remove Scalar Nanos implementation (#3955)
This commit removes the ScalarNanos methods. The Scalar methods are intended to work with the most common mappings for CLR types.
1 parent f55ccd3 commit 3d38ebc

File tree

3 files changed

+0
-102
lines changed

3 files changed

+0
-102
lines changed

src/Nest/Mapping/DynamicTemplate/SingleMapping.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -250,30 +250,6 @@ public IProperty Scalar(Expression<Func<T, IEnumerable<DateTimeOffset?>>> field,
250250
) =>
251251
selector.InvokeOrDefault(new DatePropertyDescriptor<T>().Name(field));
252252

253-
public IProperty ScalarNanos(Expression<Func<T, DateTime>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
254-
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));
255-
256-
public IProperty ScalarNanos(Expression<Func<T, DateTime?>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
257-
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));
258-
259-
public IProperty ScalarNanos(Expression<Func<T, IEnumerable<DateTime>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
260-
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));
261-
262-
public IProperty ScalarNanos(Expression<Func<T, IEnumerable<DateTime?>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
263-
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));
264-
265-
public IProperty ScalarNanos(Expression<Func<T,DateTimeOffset>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
266-
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));
267-
268-
public IProperty ScalarNanos(Expression<Func<T, DateTimeOffset?>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
269-
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));
270-
271-
public IProperty ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
272-
) => selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));
273-
274-
public IProperty ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset?>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
275-
) => selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));
276-
277253
public IProperty Scalar(Expression<Func<T, bool>> field, Func<BooleanPropertyDescriptor<T>, IBooleanProperty> selector = null) =>
278254
selector.InvokeOrDefault(new BooleanPropertyDescriptor<T>().Name(field));
279255

src/Nest/Mapping/Types/Properties-Scalar.cs

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,6 @@ public partial interface IPropertiesDescriptor<T, out TReturnType>
115115

116116
TReturnType Scalar(Expression<Func<T, IEnumerable<DateTimeOffset?>>> field, Func<DatePropertyDescriptor<T>, IDateProperty> selector = null);
117117

118-
TReturnType ScalarNanos(Expression<Func<T, DateTime>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);
119-
120-
TReturnType ScalarNanos(Expression<Func<T, DateTime?>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);
121-
122-
TReturnType ScalarNanos(Expression<Func<T, IEnumerable<DateTime>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);
123-
124-
TReturnType ScalarNanos(Expression<Func<T, IEnumerable<DateTime?>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);
125-
126-
TReturnType ScalarNanos(Expression<Func<T, DateTimeOffset>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);
127-
128-
TReturnType ScalarNanos(Expression<Func<T, DateTimeOffset?>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);
129-
130-
TReturnType ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);
131-
132-
TReturnType ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset?>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);
133-
134118
TReturnType Scalar(Expression<Func<T, bool>> field, Func<BooleanPropertyDescriptor<T>, IBooleanProperty> selector = null);
135119

136120
TReturnType Scalar(Expression<Func<T, bool?>> field, Func<BooleanPropertyDescriptor<T>, IBooleanProperty> selector = null);
@@ -404,42 +388,6 @@ public PropertiesDescriptor<T> Scalar(Expression<Func<T, IEnumerable<DateTimeOff
404388
) =>
405389
SetProperty(selector.InvokeOrDefault(new DatePropertyDescriptor<T>().Name(field)));
406390

407-
public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, DateTime>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
408-
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));
409-
410-
public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, DateTime?>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
411-
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));
412-
413-
public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, IEnumerable<DateTime>>> field,
414-
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
415-
) =>
416-
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));
417-
418-
public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, IEnumerable<DateTime?>>> field,
419-
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
420-
) =>
421-
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));
422-
423-
public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, DateTimeOffset>> field,
424-
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
425-
) =>
426-
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));
427-
428-
public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, DateTimeOffset?>> field,
429-
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
430-
) =>
431-
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));
432-
433-
public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset>>> field,
434-
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
435-
) =>
436-
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));
437-
438-
public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset?>>> field,
439-
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
440-
) =>
441-
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));
442-
443391
public PropertiesDescriptor<T> Scalar(Expression<Func<T, bool>> field, Func<BooleanPropertyDescriptor<T>, IBooleanProperty> selector = null
444392
) =>
445393
SetProperty(selector.InvokeOrDefault(new BooleanPropertyDescriptor<T>().Name(field)));

src/Tests/Tests/Mapping/Scalar/ScalarUsageTests.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ public enum ScalarEnum
3636
dateTimeOffsets = new { type = "date" },
3737
dateTimeOffsetNullable = new { type = "date" },
3838
dateTimeOffsetNullables = new { type = "date" },
39-
dateTimeNanos = new { type = "date_nanos" },
40-
dateTimeNanoss = new { type = "date_nanos" },
41-
dateTimeNanosNullable = new { type = "date_nanos" },
42-
dateTimeNanosNullables = new { type = "date_nanos" },
43-
dateTimeNanosOffset = new { type = "date_nanos" },
44-
dateTimeNanosOffsets = new { type = "date_nanos" },
45-
dateTimeNanosOffsetNullable = new { type = "date_nanos" },
46-
dateTimeNanosOffsetNullables = new { type = "date_nanos" },
4739
@decimal = new { type = "double" },
4840
decimals = new { type = "double" },
4941
decimalNullable = new { type = "double" },
@@ -153,14 +145,6 @@ public enum ScalarEnum
153145
.Scalar(p => p.DateTimeOffsets, m => m)
154146
.Scalar(p => p.DateTimeOffsetNullable, m => m)
155147
.Scalar(p => p.DateTimeOffsetNullables, m => m)
156-
.ScalarNanos(p => p.DateTimeNanos, m => m)
157-
.ScalarNanos(p => p.DateTimeNanoss, m => m)
158-
.ScalarNanos(p => p.DateTimeNanosNullable, m => m)
159-
.ScalarNanos(p => p.DateTimeNanosNullables, m => m)
160-
.ScalarNanos(p => p.DateTimeNanosOffset, m => m)
161-
.ScalarNanos(p => p.DateTimeNanosOffsets, m => m)
162-
.ScalarNanos(p => p.DateTimeNanosOffsetNullable, m => m)
163-
.ScalarNanos(p => p.DateTimeNanosOffsetNullables, m => m)
164148
.Scalar(p => p.Bool, m => m)
165149
.Scalar(p => p.Bools, m => m)
166150
.Scalar(p => p.BoolNullable, m => m)
@@ -216,16 +200,6 @@ public class ScalarPoco
216200
public IEnumerable<DateTimeOffset> DateTimeOffsets { get; set; }
217201
public IEnumerable<DateTime> DateTimes { get; set; }
218202

219-
public DateTime DateTimeNanos { get; set; }
220-
public DateTime? DateTimeNanosNullable { get; set; }
221-
public IEnumerable<DateTime?> DateTimeNanosNullables { get; set; }
222-
223-
public DateTimeOffset DateTimeNanosOffset { get; set; }
224-
public DateTimeOffset? DateTimeNanosOffsetNullable { get; set; }
225-
public IEnumerable<DateTimeOffset?> DateTimeNanosOffsetNullables { get; set; }
226-
public IEnumerable<DateTimeOffset> DateTimeNanosOffsets { get; set; }
227-
public IEnumerable<DateTime> DateTimeNanoss { get; set; }
228-
229203
public decimal Decimal { get; set; }
230204
public decimal? DecimalNullable { get; set; }
231205
public IEnumerable<decimal?> DecimalNullables { get; set; }

0 commit comments

Comments
 (0)