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

Refactor logging and error messages in serverless #1923

Merged
merged 8 commits into from
Oct 6, 2021
13 changes: 11 additions & 2 deletions sdk/python/feast/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import logging
from datetime import datetime
from pathlib import Path
from typing import List
from typing import List, Optional

import click
import pkg_resources
Expand Down Expand Up @@ -57,8 +57,12 @@ def format_options(self, ctx: click.Context, formatter: click.HelpFormatter):
"-c",
help="Switch to a different feature repository directory before executing the given subcommand.",
)
@click.option(
"--log",
felixwang9817 marked this conversation as resolved.
Show resolved Hide resolved
help="The logging level. One of DEBUG, INFO, WARNING, ERROR, and CRITICAL (case-insensitive).",
)
@click.pass_context
def cli(ctx: click.Context, chdir: str):
def cli(ctx: click.Context, chdir: Optional[str], log: Optional[str]):
"""
Feast CLI

Expand All @@ -68,6 +72,11 @@ def cli(ctx: click.Context, chdir: str):
"""
ctx.ensure_object(dict)
ctx.obj["CHDIR"] = Path.cwd() if chdir is None else Path(chdir).absolute()
try:
if log is not None:
felixwang9817 marked this conversation as resolved.
Show resolved Hide resolved
logging.basicConfig(level=getattr(logging, log.upper()))
felixwang9817 marked this conversation as resolved.
Show resolved Hide resolved
except Exception as e:
raise e
pass


Expand Down
3 changes: 1 addition & 2 deletions sdk/python/feast/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
# Maximum interval(secs) to wait between retries for retry function
MAX_WAIT_INTERVAL: str = "60"

# Dockerhub name for the AWS Lambda feature server docker image.
AWS_LAMBDA_FEATURE_SERVER_IMAGE = "feastdev/feature-server:aws-v0.1"
AWS_LAMBDA_FEATURE_SERVER_IMAGE = "feastdev/feature-server:aws"

# feature_store.yaml environment variable name for remote feature server
FEATURE_STORE_YAML_ENV_NAME: str = "FEATURE_STORE_YAML_BASE64"
Expand Down
4 changes: 0 additions & 4 deletions sdk/python/feast/infra/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
raise FeastExtrasDependencyImportError("aws", str(e))

_logger = logging.getLogger(__name__)
_logger.setLevel(logging.INFO)
_handler = logging.StreamHandler()
_handler.setLevel(logging.INFO)
_logger.addHandler(_handler)


class AwsProvider(PassthroughProvider):
Expand Down