Skip to content

Internalize ITransformTemplate #2334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Ivanidzo4ka
Copy link
Contributor

Towards #1995

Ivan Matantsev added 3 commits January 4, 2019 10:51

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
heitorlessa Heitor Lessa
@Ivanidzo4ka Ivanidzo4ka changed the title [WIP] [Don't review] Internalize ITransformTemplate Internalize ITransformTemplate Jan 31, 2019
@codecov
Copy link

codecov bot commented Jan 31, 2019

Codecov Report

Merging #2334 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2334      +/-   ##
==========================================
- Coverage   71.16%   71.16%   -0.01%     
==========================================
  Files         780      780              
  Lines      140340   140338       -2     
  Branches    16048    16043       -5     
==========================================
- Hits        99879    99869      -10     
- Misses      36011    36019       +8     
  Partials     4450     4450
Flag Coverage Δ
#Debug 71.16% <100%> (-0.01%) ⬇️
#production 67.57% <100%> (-0.01%) ⬇️
#test 85.09% <ø> (-0.01%) ⬇️

@@ -97,7 +97,8 @@ public interface IDataTransform : IDataView, ICanSaveModel
/// Data transforms need to be able to apply themselves to a different input IDataView.
/// This interface allows them to implement custom rebinding logic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic [](start = 65, length = 5)

Until we can delete this altogether, it may be worthwhile to add a note here to explain that the preferred idioms is that things work via the new ITransformer mechanism, which is the successor of this sort of idiom. I might not suggest adding the [Obsolete] tag -- that's a bit heaviweight -- just something in the XML docstring here like, "yeah, yeah, this is here, but we're trying to get rid of it, don't write new code with it."

@@ -682,7 +682,7 @@ public Row GetRow(Row input, Func<int, bool> active)
return new RowImpl(input, _mapper);
}

public IDataTransform ApplyToData(IHostEnvironment env, IDataView newSource)
IDataTransform ITransformTemplate.ApplyToData(IHostEnvironment env, IDataView newSource)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ITransformTemplate [](start = 27, length = 18)

I agree with you that this is probably the best policy since it even discourages internal code from using this now deprecated idiom, but just in case you are curious, it is not necessary to do this here since this nested class (SelectColumnsDataTransform) is itself not public.

Copy link
Contributor

@TomFinley TomFinley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Ivanidzo4ka , just one very minor comment about documentation to discourage any future use, but feel free to ignore unless you find you have to make a different change for some other reason.

IDataTransform ITransformTemplate.ApplyToData(IHostEnvironment env, IDataView newSource)
=> ApplyToDataCore(env, newSource);
internal IDataView ApplyToData(IHostEnvironment env, IDataView newSource)
=> ApplyToDataCore(env, newSource);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this second method? IDataTransform derives from IDataView.

Copy link
Contributor

@artidoro artidoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@Ivanidzo4ka Ivanidzo4ka merged commit 284d196 into dotnet:master Feb 1, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants