Skip to content

Commit bbb35ca

Browse files
authored
Merge pull request #951 from netenglabs/lib-upd8s-23
update libs for 0.23 release
2 parents 27cd71d + 5b41426 commit bbb35ca

File tree

14 files changed

+2302
-326
lines changed

14 files changed

+2302
-326
lines changed

build/requirements.txt

Lines changed: 2002 additions & 158 deletions
Large diffs are not rendered by default.

poetry.lock

Lines changed: 254 additions & 138 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ classifiers = [
1717

1818
[tool.poetry.dependencies]
1919
python = ">3.8.1, < 3.10"
20-
aiohttp = "==3.7.4"
21-
asyncssh = "~2.11"
20+
aiohttp = ">3.8, <4.0"
21+
asyncssh = "~2.14"
2222
textfsm = "*"
23-
async-timeout = "<4.0"
23+
async-timeout = ">4.0, <5.0"
2424
aiofiles = "*"
2525
prompt-toolkit = ">2"
2626
pyarrow = "~11.0"
2727
pandas = "~1.5"
2828
PyYAML = "*"
2929
python-nubia = "0.2b5"
3030
uvloop = "*"
31-
networkx = "^2.4"
32-
matplotlib = "^3.2.2"
33-
faker = "^4.1.1"
34-
netconan = "^0.11.2"
35-
jsonpath-ng = "^1.5.1"
36-
fastapi = "~0.95"
31+
networkx = "~2.4"
32+
matplotlib = "~3.7"
33+
faker = "~4.18"
34+
netconan = "~0.11.2"
35+
jsonpath-ng = "~1.6"
36+
fastapi = "~0.95.2"
3737
uvicorn = "^0.14.0"
3838
tabulate = "^0.8.7"
3939
streamlit = "1.11.1"
@@ -43,15 +43,17 @@ natsort = "^8.0.0"
4343
colorama = "^0.4.4"
4444
tzlocal = "< 3.0"
4545
pyparsing = ">=2.2.0, <3.0"
46-
xmltodict = "^0.12.0"
47-
streamlit-aggrid = "^0.2.2"
48-
ciscoconfparse = "^1.6.21"
46+
xmltodict = "~0.12.0"
47+
streamlit-aggrid = "~0.2.2"
48+
ciscoconfparse = "~1.6.21"
4949
notebook = "6.4.12"
50-
urllib3 = "^1.26.12"
51-
packaging = "^21.3"
52-
psutil = "^5.9.4"
50+
urllib3 = "~1.26.12"
51+
packaging = "~21.3"
52+
psutil = "~5.9.4"
5353
jellyfish = "~0.10"
5454
altair = '>3.2, <5.0'
55+
pydantic = '< 2.0'
56+
numpy = '~1.20'
5557

5658
[tool.poetry.dev-dependencies]
5759
pylint = "*"

suzieq/db/parquet/parquetdb.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import re
33
from time import time
4-
from typing import List, Optional
4+
from typing import Any, Callable, List, Optional
55
import logging
66
from pathlib import Path
77
from datetime import datetime, timedelta, timezone
@@ -130,8 +130,7 @@ def read(self, table_name: str, data_format: str,
130130
continue
131131
if need_sqvers:
132132
vers = float(str(elem).split('=')[-1])
133-
if vers > max_vers:
134-
max_vers = vers
133+
max_vers = max(vers, max_vers)
135134

136135
dataset = ds.dataset(elem, format='parquet',
137136
partitioning='hive')
@@ -226,6 +225,9 @@ def write(self, table_name: str, data_format: str,
226225
df = pd.DataFrame.from_dict(data["records"])
227226
table = pa.Table.from_pandas(df, schema=schema,
228227
preserve_index=False)
228+
else:
229+
raise ValueError('Unknown format of data provided:'
230+
f'{type(data)}')
229231

230232
pq.write_to_dataset(table,
231233
root_path=folder,
@@ -539,8 +541,7 @@ def _get_cp_dataset(self, table_name: str, need_sqvers: bool,
539541
continue
540542
if need_sqvers:
541543
vers = float(str(elem).split('=')[-1])
542-
if vers > max_vers:
543-
max_vers = vers
544+
max_vers = max(vers, max_vers)
544545

545546
dataset = ds.dataset(elem, format='parquet', partitioning='hive')
546547

@@ -618,7 +619,7 @@ def _get_filtered_fileset(self, dataset: ds, namespaces: list) -> ds:
618619
ds: pyarrow dataset of only the files that match filter
619620
"""
620621
def check_ns_conds(ns_to_test: str, filter_list: List[str],
621-
op: operator.or_) -> bool:
622+
op: Callable[[Any, Any], Any]) -> bool:
622623
"""Concat the expressions with the provided (AND or OR) operator
623624
and return the result of the resulting expression tested on the
624625
provided namespace.
@@ -631,11 +632,10 @@ def check_ns_conds(ns_to_test: str, filter_list: List[str],
631632
Returns:
632633
bool: the result of the expression
633634
"""
634-
# pylint: disable=comparison-with-callable
635635
# We would like to init the result to False if we concat the
636636
# expressions with OR, while with True if we use AND.
637637
res = False
638-
if operator.and_ == op:
638+
if operator.and_ is op:
639639
res = True
640640
for filter_val in filter_list:
641641
ns_to_test = ns_to_test.split('namespace=')[-1]

suzieq/engines/pandas/routes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def _cons_addnl_fields(self, columns: List[str], addnl_fields: List[str],
3535

3636
return addnl_fields
3737

38-
# pylint: disable=too-many-statements
3938
def get(self, **kwargs):
4039
'''Return the routes table for the given filters'''
4140

suzieq/gui/stlit/path.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,14 @@ def _get_path(self, forward_dir: bool = True) -> Tuple[pd.DataFrame,
259259
vrf=self._state.vrf)
260260

261261
summ_df = self._path_summarize(df)
262+
else:
263+
df = self._pathobj.get(namespace=[self._state.namespace],
264+
src=self._state.dest,
265+
dest=self._state.source,
266+
vrf=self._state.vrf)
267+
268+
summ_df = self._path_summarize(df)
269+
262270
return df, summ_df
263271

264272
def _get_failed_data(self, namespace: str, pgbar) -> None:

suzieq/gui/stlit/xplore.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ def _draw_aggrid_df(self, df) -> AgGrid:
389389

390390
start_row = self._state.start_row
391391
end_row = self._state.end_row
392-
if end_row > df.shape[0]:
393-
end_row = df.shape[0]
392+
end_row = min(end_row, df.shape[0])
394393

395394
if end_row - start_row > MAX_ROW_WARN:
396395
st.warning('Printing too many rows can fail or be very slow')

suzieq/poller/controller/source/ansible.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class AnsibleSourceModel(SourceModel):
2323
def validate_and_set(cls, path: str):
2424
"""checks if the path is valid
2525
"""
26+
inventory = None
2627
if isinstance(path, str):
2728
if not Path(path).is_file():
2829
raise ValueError(
@@ -38,6 +39,10 @@ def validate_and_set(cls, path: str):
3839

3940
elif isinstance(path, Dict):
4041
inventory = path
42+
43+
if not inventory:
44+
raise ValueError('Unknown inventory format: expect path or dict')
45+
4146
if '_meta' not in inventory \
4247
or 'hostvars' not in inventory['_meta']:
4348
if isinstance(inventory, list) and 'namespace' in inventory[0]:

suzieq/poller/worker/nodes/node.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ async def _post_result(self, service_callback: asyncio.coroutine,
344344
async def _parse_device_type_hostname(self, output, _) -> None:
345345
devtype = ""
346346
hostname = None
347+
version_str = '0.0.0' # default that's possibly never used
347348

348349
if output[0]["status"] == 0:
349350
# don't keep trying if we're connected to an unsupported dev

suzieq/poller/worker/services/evpnVni.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def _clean_junos_data(self, processed_data, _):
198198
'vrf': vrf,
199199
'os': 'junos'
200200
}
201-
newntries[vni] = vni_entry
201+
newntries[vni] = vni_entry
202202
continue
203203
elif entry['_entryType'] == 'l3':
204204
vni = int(entry.get('vni', '0'))

0 commit comments

Comments
 (0)