Skip to content

Add errors param to $lib.axon.readlines (SYN-6359) #3395

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

Merged
merged 6 commits into from
Oct 23, 2023

Conversation

Cisphyx
Copy link
Contributor

@Cisphyx Cisphyx commented Oct 19, 2023

No description provided.

''',
'type': {'type': 'function', '_funcname': 'readlines',
'args': (
{'name': 'sha256', 'type': 'str', 'desc': 'The SHA256 hash of the file.'},
{'name': 'errors', 'type': 'str', 'default': None,
Copy link
Contributor

Choose a reason for hiding this comment

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

we should probably make this default to "ignore" ( or at least "surrogatepass") so the intuitive thing happens. ( both here and in the python/telepath API )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, I left it as none because we had a test for the current behavior but I agree ignore/surrogatepass makes more sense as the default.

if not self.runt.allowed(('axon', 'get')):
self.runt.confirm(('storm', 'lib', 'axon', 'get'))
await self.runt.snap.core.getAxon()

sha256 = await tostr(sha256)
async for line in self.runt.snap.core.axon.readlines(sha256):
async for line in self.runt.snap.core.axon.readlines(sha256, errors=errors):
yield line

async def jsonlines(self, sha256):
Copy link
Contributor

Choose a reason for hiding this comment

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

csvrows and jsonlines probably need this option too

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a10b2cd) 97.31% compared to head (a3ccad2) 97.20%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3395      +/-   ##
==========================================
- Coverage   97.31%   97.20%   -0.12%     
==========================================
  Files         231      231              
  Lines       46966    46966              
==========================================
- Hits        45707    45654      -53     
- Misses       1259     1312      +53     
Flag Coverage Δ
linux 97.20% <100.00%> (-0.02%) ⬇️
linux_replay ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
synapse/axon.py 98.09% <100.00%> (-0.14%) ⬇️
synapse/lib/stormtypes.py 98.80% <100.00%> (ø)

... and 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@invisig0th invisig0th merged commit bedf67c into master Oct 23, 2023
@invisig0th invisig0th deleted the axon-readlines-errors branch October 23, 2023 18:13
@vEpiphyte vEpiphyte added this to the v2.15x.x milestone Oct 26, 2023
@vEpiphyte vEpiphyte added bug reqChangelog requires changelog enhancement and removed reqChangelog requires changelog labels Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants