Skip to content

Commit

Permalink
Refactor logging statements and improve print messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhargav Dodla committed Mar 21, 2024
1 parent d94a1d0 commit f1ac905
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@

warnings.simplefilter("ignore", DeprecationWarning)

logger = logging.getLogger(__name__)

if TYPE_CHECKING:
from feast.embedded_go.online_features_service import EmbeddedOnlineFeatureServer

logger = logging.getLogger(__name__)


class FeatureStore:
"""
Expand Down Expand Up @@ -1330,16 +1330,16 @@ def materialize_incremental(
else:
# TODO(felixwang9817): Find the earliest timestamp for this specific feature
# view from the offline store, and set the start date to that timestamp.
logger.info(
f"Since the ttl is 0 for feature view {feature_view.name}, \
the start date will be set to 1 year before the current time."
print(
f"Since the ttl is 0 for feature view {Style.BRIGHT + Fore.GREEN}{feature_view.name}{Style.RESET_ALL}, "
"the start date will be set to 1 year before the current time."
)
start_date = datetime.utcnow() - timedelta(weeks=52)
provider = self._get_provider()

logger.info(
f"{feature_view.name} from {start_date.replace(microsecond=0).astimezone()} \
to {end_date.replace(microsecond=0).astimezone()}"
print(
f"{Style.BRIGHT + Fore.GREEN}{feature_view.name}{Style.RESET_ALL}"
f" from {Style.BRIGHT + Fore.GREEN}{start_date.replace(microsecond=0).astimezone()}{Style.RESET_ALL}"
f" to {Style.BRIGHT + Fore.GREEN}{end_date.replace(microsecond=0).astimezone()}{Style.RESET_ALL}:"
)

def tqdm_builder(length):
Expand Down Expand Up @@ -1415,7 +1415,7 @@ def materialize(
# TODO paging large loads
for feature_view in feature_views_to_materialize:
provider = self._get_provider()
logger.info(f"Materializing feature view {feature_view.name}")
print(f"{Style.BRIGHT + Fore.GREEN}{feature_view.name}{Style.RESET_ALL}:")

def tqdm_builder(length):
return tqdm(total=length, ncols=100)
Expand Down Expand Up @@ -2480,7 +2480,7 @@ def validate_logged_features(

return exc
else:
logger.info(f"{t.shape[0]} rows were validated.")
print(f"{t.shape[0]} rows were validated.")

if cache_profile:
self.apply(reference)
Expand Down

0 comments on commit f1ac905

Please sign in to comment.