Skip to content
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

Fix unable to mapReduce with decorator on an Instance type #78

Merged
merged 2 commits into from
May 29, 2017
Merged

Fix unable to mapReduce with decorator on an Instance type #78

merged 2 commits into from
May 29, 2017

Conversation

RagibHasin
Copy link
Contributor

Sorry for knocking again.
I noticed that when applying mapReduce functions with decorators, it failed to compile. (Actually for the ugly static type checks I added at the last moment). So it seems better to me to check for those functions at runtime which will also be useful for JavaScript users. And added accompanying test.
Best regards.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling c79b2a4 on RagibHasin:master into ** on SierraSoftworks:master**.

Copy link
Member

@notheotherben notheotherben left a comment

Choose a reason for hiding this comment

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

Looks mostly pretty good, I don't believe it'll break any existing code with the previous API, but can you confirm that quickly please? (will determine whether this is a patch or major version bump)

Otherwise, all looks like a nice improvement on the approach being used.

lib/Model.ts Outdated
return resolve();
});
}
else return reject("mapReduceOptions not provided");
Copy link
Member

Choose a reason for hiding this comment

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

Can we reject this with an actual Error object? Strings as errors are generally a bad idea for debugging and handling purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! 😛 My mistake. Just missed the new Error.

lib/Model.ts Outdated
if (err) return reject(err);
return resolve();
});
if (instanceType.mapReduceOptions) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we rather shift this test up to the top of this function (line 733 or so) to make it easier to read?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course. That will be cleaner.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 5eb054f on RagibHasin:master into ** on SierraSoftworks:master**.

@notheotherben
Copy link
Member

Looks good, I'll go about merging and releasing this this evening if that works for you? Let me know if it's more urgent and I'll shuffle some stuff around.

@RagibHasin
Copy link
Contributor Author

It is not very important but is good to get it released. I'm using my fork at this moment for a project. And it did not break any previous code of mine.
You may finish your works in hand before releasing.

@notheotherben notheotherben merged commit 23a3d1a into SierraSoftworks:master May 29, 2017
@notheotherben
Copy link
Member

Deployed in v7.2.1 - thanks for the PR @RagibHasin and as always, if you run into any issues please feel free to open an issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants