Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 2, 2024. It is now read-only.
/sdcPublic archive

Expand TypeChecker to raise SDCLimitation('...Unsupported...')#771

Open
densmirn wants to merge4 commits intoIntelPython:master
base:master
Choose a base branch
Loading
fromdensmirn:feature/ty_checker

Conversation

densmirn
Copy link
Contributor

No description provided.

self._raise_exc(self, exc_cls, self.default_tmpl, self.func_name,
name, data, expected_types)

def raise_unsupported_exc(self, data, name='', exc_cls=TypingError):
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use default exception as SDCLimitation, as it seems to be more appropriate in this case?

self._raise_exc(exc_cls, self.default_tmpl, self.func_name,
name, data, expected_types)

def raise_unsupported_exc(self, data, name='', exc_cls=SDCLimitation):
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking of replacing all raises related to SDC limitations with this, but it seems this only covers case of unsupported parameters, so for instance in series.fillna we have:

            raise TypingError('{} Not implemented when Series dtype is {} and\                 inplace={}'.format(_func_name, self.dtype, inplace))

Maybe add in raise_exc and internal func additional parameter e.g. msg, which if exists will be used instead of default msg format?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Do you mean to replace call

msg='{} Not implemented when Series dtype is {} and inplace={}'.format(_func_name,self.dtype,inplace)raiseSDCLimitation(msg)

with something like this

msg='{} Not implemented when Series dtype is {} and inplace={}'.format(_func_name,self.dtype,inplace)ty_checker.raise_exc(None,None,exc_cls=SDCLimitation,msg=msg)

?

I thinkTypeChecker shouldn't be used for such complicated cases,TypeChecker doesn't make sense, when it increases the amount of code and makes it harder.
Maybe I didn't catch you correctly, please correct me in this case.

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@kozlov-alexeykozlov-alexeykozlov-alexey left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@densmirn@kozlov-alexey

[8]ページ先頭

©2009-2025 Movatter.jp