Skip to content

Commit e094ed6

Browse files
committed
chore: fix deprecation warning and update disco v2 test
1 parent f70b42b commit e094ed6

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

Scripts/Services/PersonalityInsights/V3/PersonalityInsightsService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929

3030
namespace IBM.Watson.PersonalityInsights.V3
3131
{
32+
[System.Obsolete("On 1 December 2021, Personality Insights will no longer be available." +
33+
" Consider migrating to Watson Natural Language Understanding." +
34+
"\nFor more information, see Personality Insights Deprecation " +
35+
"(https://github.com/watson-developer-cloud/unity-sdk/tree/master#personality-insights-deprecation).")]
36+
3237
public partial class PersonalityInsightsService : BaseService
3338
{
3439
private const string serviceId = "personality_insights";

Scripts/Services/VisualRecognition/V3/VisualRecognitionService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828

2929
namespace IBM.Watson.VisualRecognition.V3
3030
{
31+
[System.Obsolete("On 1 December 2021, Visual Recognition will no longer be available. " +
32+
"For more information, see Visual Recognition Deprecation " +
33+
"(https://github.com/watson-developer-cloud/unity-sdk/tree/master#visual-recognition-deprecation).")]
3134
public partial class VisualRecognitionService : BaseService
3235
{
3336
private const string serviceId = "visual_recognition";
@@ -70,7 +73,6 @@ public VisualRecognitionService(string versionDate) : this(versionDate, ConfigBa
7073
/// <param name="authenticator">The service authenticator.</param>
7174
public VisualRecognitionService(string versionDate, Authenticator authenticator) : base(versionDate, authenticator, serviceId)
7275
{
73-
Log.Warning("Visual Recognition Deprecation Warning:", "On 1 December 2021, Visual Recognition will no longer be available. For more information, see https://github.com/watson-developer-cloud/unity-sdk/tree/master#visual-recognition-deprecation.");
7476
Authenticator = authenticator;
7577

7678
if (string.IsNullOrEmpty(versionDate))

Scripts/Services/VisualRecognition/V4/VisualRecognitionService.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030

3131
namespace IBM.Watson.VisualRecognition.V4
3232
{
33+
[System.Obsolete("On 1 December 2021, Visual Recognition will no longer be available. " +
34+
"For more information, see Visual Recognition Deprecation " +
35+
"(https://github.com/watson-developer-cloud/unity-sdk/tree/master#visual-recognition-deprecation).")]
3336
public partial class VisualRecognitionService : BaseService
3437
{
3538
private const string serviceId = "visual_recognition";
@@ -72,7 +75,6 @@ public VisualRecognitionService(string versionDate) : this(versionDate, ConfigBa
7275
/// <param name="authenticator">The service authenticator.</param>
7376
public VisualRecognitionService(string versionDate, Authenticator authenticator) : base(versionDate, authenticator, serviceId)
7477
{
75-
Log.Warning("VisualRecognition Deprecation Warning:", "On 1 December 2021, Visual Recognition will no longer be available. For more information, see https://github.com/watson-developer-cloud/unity-sdk/tree/master#visual-recognition-deprecation.");
7678
Authenticator = authenticator;
7779

7880
if (string.IsNullOrEmpty(versionDate))
@@ -1529,11 +1531,11 @@ public bool GetTrainingUsage(Callback<TrainingEvents> callback, DateTime? startT
15291531
req.Parameters["version"] = VersionDate;
15301532
if (startTime != null)
15311533
{
1532-
req.Parameters["start_time"] = startTime;
1534+
req.Parameters["start_time"] = startTime?.ToString("yyyy-MM-dd");
15331535
}
15341536
if (endTime != null)
15351537
{
1536-
req.Parameters["end_time"] = endTime;
1538+
req.Parameters["end_time"] = endTime?.ToString("yyyy-MM-dd");
15371539
}
15381540

15391541
req.OnResponse = OnGetTrainingUsageResponse;

Tests/DiscoveryV2IntegrationTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class DiscoveryV2IntegrationTests
5050
public void OneTimeSetup()
5151
{
5252
LogSystem.InstallDefaultReactors();
53-
analyzeDocumentFile = Application.dataPath + "/Watson/Tests/TestData/DiscoveryV2/WatsonBeatsJeopardy.html";
53+
analyzeDocumentFile = Application.dataPath + "/Watson/Tests/TestData/DiscoveryV1/exampleConfigurationData.json";
5454

5555
addDocumentFile = Application.dataPath + "/Watson/Tests/TestData/DiscoveryV2/TestAddDoc.pdf";
5656
enrichmentFile = Application.dataPath + "/Watson/Tests/TestData/DiscoveryV2/TestEnrichments.csv";
@@ -680,9 +680,8 @@ public IEnumerator TestAnalyzeDocument()
680680
projectId: "{projectId}",
681681
collectionId: "{collectionId}",
682682
file: ms,
683-
filename: "WatsonBeatsJeopardy.html",
684-
fileContentType: "text/html",
685-
metadata: "{ \"metadata\": \"value\" }"
683+
filename: "exampleConfigurationData.json",
684+
fileContentType: "application/json"
686685
);
687686
}
688687
}

0 commit comments

Comments
 (0)