Uh oh!
There was an error while loading. Please reload this page.
Fixes #17438 - Ensure that isinteractive multi-emit backing fields are not public - #17439
Conversation
❗ Release notes required
|
Szer
commented
Jul 24, 2024
I'll test it in 24 hours in all scenarios where it broke for me |
KevinRansom
commented
Jul 24, 2024
@Szer, thanks mate, that would help. |
checked with snippet below Fails on #r "nuget: Microsoft.ML, 3.0.1"openMicrosoft.MLopenMicrosoft.ML.DataopenSystem.IO[<CLIMutable>]typeSpamOrHam={[<LoadColumn(0)>]
text:string[<LoadColumn(1)>]
spam:bool }letcontent="""text,spamabc,spam123,ham"""lettempPath= Path.GetTempFileName()
File.WriteAllText(tempPath, content)try
MLContext().Data.LoadFromTextFile<SpamOrHam>(tempPath, separatorChar =',', hasHeader =true)finally
File.Delete tempPath |
Szer
commented
Jul 24, 2024
Newtonsoft.Json snippet below works everywhere #r "nuget: Newtonsoft.Json, 13.0.3"openNewtonsoft.JsontypeFoo={ id:int }{ id =1}|> JsonConvert.SerializeObject
|>fun x ->if x <>"""{"id":1}"""then failwith x |
KevinRansom
commented
Jul 24, 2024
@Szer , thanks this it really helps. Kevin |
Uh oh!
There was an error while loading. Please reload this page.
vzarytovskii
left a comment
There was a problem hiding this comment.
Is it worth adding some sort of IL test for the interactive? I don't think I've been adding support of it to the testing framework though.
I would like to, but we do it in memory. Generating IL would be a touch slower. Perhaps in the future we can consider adding a --testonly:writetofile option to fsi to |
Fixes#17438 - Ensure that isinteractive multi-emit backing fields are not public
dotnet interactive multiemit+ previously made the backing fields for records, unions, E.t.c public, whereas multiemit-makes them internal.
Some poorly written serializers, include public fields specified with a CompilerGeneratedAttribute in the serialization stream.
This means that multiemit**-** has become a work around in scenarios that rely on fsi and serialization using these types of serializers.
This PR fixes the problem by correctly specifying fields as Private (actually internal). As implementation details they are also internal when compiled with realsig**+**
I believe the original reason for making the backing field public was so that fsi could reliably access it from multi-emit assemblies. Due to implementation issues there was previously a limit of 30 internal visible following assemblies. Now that it has been corrected, all multi-emit assemblies in a session have internals visible so, making the fields internal should work correctly.
Todo:
Background:
@Szer
#17308 (comment)
Could you verify that this fix works for your scenario ... I believe it does, but I don't really use ML.net