Skip to content

Commit

Permalink
dont require enum to contain new engine names (DynamoDS#13841)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkkirschner authored and sm6srw committed Mar 29, 2023
1 parent 956295a commit 85ee523
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/Libraries/PythonNodeModels/PythonNode.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
Expand Down Expand Up @@ -54,6 +54,11 @@ public PythonEngineVersion Engine
if (!Enum.TryParse(engine, out PythonEngineVersion engineVersion) ||
engineVersion == PythonEngineVersion.Unspecified)
{
//if this is a valid dynamically loaded engine, return unknown, and serialize the name.
if (PythonEngineManager.Instance.AvailableEngines.Any(x=>x.Name == engine))
{
return PythonEngineVersion.Unknown;
}
// This is a first-time case for newly created nodes only
SetEngineByDefault();
}
Expand Down Expand Up @@ -431,4 +436,4 @@ public override IEnumerable<AssociativeNode> BuildOutputAst(
};
}
}
}
}
5 changes: 3 additions & 2 deletions src/NodeServices/PythonServices.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand All @@ -19,7 +19,8 @@ public enum PythonEngineVersion
{
Unspecified,
IronPython2,
CPython3
CPython3,
Unknown
}
}

Expand Down

0 comments on commit 85ee523

Please sign in to comment.