Skip to content

Commit

Permalink
Address Anna cosmetic comments
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrrock2 committed Sep 25, 2024
1 parent aeaed56 commit 8ed54a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions gerrydb/repos/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,14 @@ def write_context_wrapper(*args, **kwargs):
return write_context_wrapper


# These characters are most likely to appear in the resource_id part of
# a path (typically the last segment). Exclusion of these characters
# prevents ogr2ogr fails and helps protect against malicious code injection.
INVALID_PATH_SUBSTRINGS = set(
{
"..",
" ",
";",
}
)

Expand Down
9 changes: 6 additions & 3 deletions gerrydb/repos/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get(self, path: str) -> Column:
@online
def set_values(
self,
path: Optional[str],
path: Optional[str] = None,
namespace: Optional[str] = None,
*,
col: Optional[Column] = None,
Expand All @@ -149,6 +149,8 @@ def set_values(
Args:
path: Short identifier for the column. Only this or `col` should be provided.
If both are provided, the path attribute of `col` will be used in place
of the passed `path` argument.
col: `Column` metadata object. If the `path` is not provided, the column's
path will be used.
namespace: Namespace of the column (used when `path_or_col` is a raw path).
Expand All @@ -159,7 +161,6 @@ def set_values(
Raises:
RequestError: If the values cannot be set on the server side.
"""

assert path is None or isinstance(path, str)
assert col is None or isinstance(col, Column)

Expand Down Expand Up @@ -193,7 +194,7 @@ def set_values(
@online
async def async_set_values(
self,
path: Optional[str],
path: Optional[str] = None,
namespace: Optional[str] = None,
*,
col: Optional[Column] = None,
Expand All @@ -204,6 +205,8 @@ async def async_set_values(
Args:
path: Short identifier for the column. Only this or `col` should be provided.
If both are provided, the path attribute of `col` will be used in place
of the passed `path` argument.
col: `Column` metadata object. If the `path` is not provided, the column's
path will be used.
namespace: Namespace of the column (used when `path_or_col` is a raw path).
Expand Down

0 comments on commit 8ed54a0

Please sign in to comment.