-
Notifications
You must be signed in to change notification settings - Fork 3
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
Neptune Analytics Support & Logging #23
Conversation
Replaces the queries to fetch edge directions while building the schema. The old queries worked by testing for the existance of any possible edge, which resulted in a large number of queries for graphs with lots of node and edge labels. The new query instead iterates through all the edge labels, and runs a query to fetch the corresponding from-label to-label pairs.
…eptune-Analytics---Logger
Replaces the queries to fetch edge directions while building the schema. The old queries worked by testing for the existance of any possible edge, which resulted in a large number of queries for graphs with lots of node and edge labels. The new query instead iterates through all the edge labels, and runs a query to fetch the corresponding from-label to-label pairs.
…g of test cases, and changed to analytics endpoint
This reverts commit 5e54131.
…ould also be logged to console. Added new loggerError method which logs the message to file and console.error.
…e-Analytics---Logger
…gger Reduce duplicate logging code
…er for analytics vs neptune db.
51a491d
to
12691dd
Compare
…and use parameterized query for getNodeProperties.
…e() function to check relationship type
Replaces the queries to fetch edge directions while building the schema. The old queries worked by testing for the existence of any possible edge, which resulted in a large number of queries for graphs with lots of node and edge labels. The new query instead iterates through all the edge labels, and runs a query to fetch the corresponding from-label to-label pairs.
} | ||
|
||
function sanitize(text) { | ||
// TODO implement sanitization logic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be coming in a future PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - still need to talk with AWS about the logic.
src/NeptuneSchema.js
Outdated
for (let fromLabel of result.fromLabel) { | ||
for (let toLabel of result.toLabel) { | ||
edgeStructure.directions.push({from:fromLabel, to:toLabel}); | ||
consoleOut(' Found edge: ' + yellow(edgeStructure.label) + ' direction: ' + yellow(fromLabel) + ' -> ' + yellow(toLabel)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the expectation that calls to consoleOut
should always be paired with calls to loggerLog
?
…sier maintainability and future customization. Changed the quiet option to set the console log level to 'warn' if enabled ('debug' if disabled) instead of checking for the quiet value before each log. File logging is by default at the 'debug' level but could be customized in the future with a user-provided level. Removed some ARNs and other info from logged statements for privacy concerns. (#4)
…gic (#5) Introduce usage of the neptune graph (analytics) SDK in a couple scenarios: 1. during pipeline creation, if an axios request fails when querying the Neptune Analytics graph and falls back to SDK and 2. if the user has opted to use SDK for the generated lambda (as opposed to http). Summary of changes: -added new dependency on client-neptune-graph version 3.662.0 -created new lambda template which is used if the user specifies --output-resolver-query-sdk option -set additional lambda environment variable for neptune db name which is required to execute queries using the neptune graph SDK -added logic to fall back to neptune graph SDK if Axios request fails during pipeline creation (previous logic threw Error as the analytics SDK was not yet available) -fixed function which retrieves graph summary to use neptune graph SDK if the neptune-type is neptune-graph (the summary endpoint path for neptune-db is not the same for neptune-graph) -fixed CDK pipeline to only fetch cluster info if the type is neptune-db as it is not required for Neptune-graph (analytics) -set isNeptuneIAMAuth to true if the neptune type is detected as neptune-graph -introduced util.js for parsing functions that are used across multiple modules -refactored function which had many params to use an object param instead for better readability -fixed some typos which specified 'neptume' instead of 'neptune' -changed queryNeptune function to have default value of empty object for params -change jest config from json to js to allow for globals to be set from environment variables -changed test cases to reference <AIR_ROUTES_DB_HOST> and <AIR_ROUTES_DB_PORT values which are swapped at test runtime for the environment variable values for easier test configurability and to prevent future accidental commit of real URLs -removed duplicated airports.source.schema.graphql file in test cases and changed to reference single file in parent directory -fixed Case05/case02.json which I believe was accidentally changed from remove to create pipeline -introduced new test case 7 which sets --output-resolver-query-sdk option
…equired for axios credential interceptor in the http lambda.
Refactored console output and spinners to be more like a command line progress UI and introduced debug level file logs. Setting the verbose-log option to true will log more data to the log file. Since the verbose log data can include graph data values it is intended for the user to have to opt in to this verbose logging. Changed pino standard out logger to console as the pino logger was causing interleaving log messages that were out of order with the spinners. Ensured to not log to console if a spinner is spinning as this can have unintended interleaving of output.
This PR was broken into several smaller ones: |
Sounds good. Thank you @andreachild! |
PR to release Neptune Analytics - Logger #19 changes to main
Changes:
neptune-db
todo.schema.graphql
that failed to create when utility is used with the todo schemaNote: connecting to a Neptune Analytics graph requires the additional argument:
--create-update-aws-pipeline-neptune-IAM option