mirror of
https://github.com/meshtastic/python.git
synced 2026-01-09 16:27:57 -05:00
fix linter warnings
This commit is contained in:
@@ -214,7 +214,7 @@ class MeshInterface: # pylint: disable=R0902
|
||||
return infos
|
||||
|
||||
def showNodes(
|
||||
self, includeSelf: bool = True, file=sys.stdout
|
||||
self, includeSelf: bool = True
|
||||
) -> str: # pylint: disable=W0613
|
||||
"""Show table summary of nodes in mesh"""
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
from typing import Optional
|
||||
|
||||
import pyarrow as pa
|
||||
from pyarrow import feather
|
||||
@@ -19,8 +20,8 @@ class ArrowWriter:
|
||||
"""
|
||||
self.sink = pa.OSFile(file_name, "wb") # type: ignore
|
||||
self.new_rows: list[dict] = []
|
||||
self.schema: pa.Schema | None = None # haven't yet learned the schema
|
||||
self.writer: pa.RecordBatchFileWriter | None = None
|
||||
self.schema: Optional[pa.Schema] = None # haven't yet learned the schema
|
||||
self.writer: Optional[pa.RecordBatchStreamWriter] = None
|
||||
|
||||
def close(self):
|
||||
"""Close the stream and writes the file as needed."""
|
||||
|
||||
@@ -129,7 +129,10 @@ class StructuredLogger:
|
||||
if self.include_raw:
|
||||
all_fields.append(("raw", pa.string()))
|
||||
|
||||
self.writer.set_schema(pa.schema(all_fields))
|
||||
# pass in our name->type tuples a pa.fields
|
||||
self.writer.set_schema(
|
||||
pa.schema(map(lambda x: pa.field(x[0], x[1]), all_fields))
|
||||
)
|
||||
|
||||
self.raw_file: Optional[
|
||||
io.TextIOWrapper
|
||||
@@ -182,7 +185,9 @@ class StructuredLogger:
|
||||
if r:
|
||||
di = r.named
|
||||
if last_is_str:
|
||||
di[last_field[0]] = di[last_field[0]].strip() # remove the trailing space we added
|
||||
di[last_field[0]] = di[
|
||||
last_field[0]
|
||||
].strip() # remove the trailing space we added
|
||||
if di[last_field[0]] == "":
|
||||
# If the last field is an empty string, remove it
|
||||
del di[last_field[0]]
|
||||
|
||||
Reference in New Issue
Block a user