Skip to content

extensions/table.py: Not compatible with pytype #677

@schwehr

Description

@schwehr

pytype can't tell what type will come back from self.properties.get in extensions/table.py. I had to comment out the return type annotations to make it past pytype (to stop pytype from checking). pytype thinks self.properties.get returns Optional[Any].

    @property
    def primary_geometry(self):  # -> Optional[str]:
        """The primary geometry column name"""
        return self.properties.get(PRIMARY_GEOMETRY_PROP)

    @primary_geometry.setter
    def primary_geometry(self, v: Optional[str]) -> None:
        if v is None:
            self.properties.pop(PRIMARY_GEOMETRY_PROP, None)
        else:
            self.properties[PRIMARY_GEOMETRY_PROP] = v

    @property
    def row_count(self):  # -> Optional[int]:
        """The number of rows in the dataset"""
        return self.properties.get(ROW_COUNT_PROP)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions