Skip to content
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

Initial Commit #6

Closed
wants to merge 30 commits into from
Closed

Initial Commit #6

wants to merge 30 commits into from

Conversation

DomPeliniAerospike
Copy link
Collaborator

No description provided.

Cleaned up typing
Changed parameters to have PEP compliant conventions
Listed parameters one per line (aside from self, *,)
Added types from types_pb2 as python objects
initialized test suite
made function names PEP compliant
Added keyword arguments some functions
Async support added to project (sync support removed)
Added basic unit testing
Removed proto notes in types.py
Organized imports
Changed private functions from two underscores to one.
Added wait for completion on delete
Added smoke tests for all API's
Ran black and flake8
Added Logging
Added setup files in test dir
Copy link

@hev hev left a comment

Choose a reason for hiding this comment

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

I glanced over this but I think it's too in the weeds and big of PR for me to really weigh in. Approved.

@@ -0,0 +1,2 @@
[flake8]
ignore = E501

Choose a reason for hiding this comment

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

Suggested change
ignore = E501
max-line-length = 88 # black compatability
ignore = E501, E203 # black compatability

I believe all three are needed for black compatibility

Choose a reason for hiding this comment

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

The file is called unit_tests.yml, but it looks more like integration/e2e because you are spinning up aerospike/proximus

Choose a reason for hiding this comment

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

Isn't this code auto-generated? If that's the case we might want to tell black to ignore the autogenerated files? Otherwise, we will need to ensure that black gets run on each newly generated file



class HostPort(object):
def __init__(self, address: str, port: int, isTls=False):
self.address = address
def __init__(self, *, host: str, port: int, isTls: Optional[bool] = False) -> None:

Choose a reason for hiding this comment

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

Why only keyword arguments?

def __str__(self):
bins_info = ""
for key, value in self.bins.items():
if isinstance(value, list):

Choose a reason for hiding this comment

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

Should we also handle dicts?


except Exception as e:

Choose a reason for hiding this comment

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

logger?

endpoint.address, endpoint.port, endpoint.isTls
)
except Exception as e:
warnings.warn("error creating channel: " + str(e))

Choose a reason for hiding this comment

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

logger

endpoints: vector_db_pb2.ServerEndpointList) -> grpc.Channel:
def _create_channel_from_server_endpoint_list(
self, endpoints: vector_db_pb2.ServerEndpointList
) -> grpc.aio.Channel:
# TODO: Create channel with all endpoints

Choose a reason for hiding this comment

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

Is the TODO completed by looping through all endpoints?

host = re.sub(r'%.*', '', host)
return grpc.insecure_channel(f'{host}:{port}')
host = re.sub(r"%.*", "", host)
return grpc.aio.insecure_channel(f"{host}:{port}")

Choose a reason for hiding this comment

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

Again, I am surprised that this does not need an await. Can you help me understand that if you know why?

bin_selector = self.__getBinSelector(bin_names)
self.__channelProvider.get_channel()
)
key = _get_key(key, set_name, namespace)

Choose a reason for hiding this comment

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

I find the order of these args to be unsettling :)

@DomPeliniAerospike DomPeliniAerospike closed this by deleting the head repository Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants