fix: Use logging instead of print during materialization#5805
fix: Use logging instead of print during materialization#5805Shizoqua wants to merge 7 commits intofeast-dev:masterfrom
Conversation
|
@franciscojavierarceo Good day |
|
Good day, my PR was approved 2 days ago but I haven't had any response since then. |
|
@Shizoqua There are unit tests failing for this change. Also, I think this changes the default cli console output for |
|
Hi @ntkathole ! thanks for the catch. |
ee9e526 to
007c26c
Compare
|
@ntkathole that's true it does change the default output. That's probably the right thing actually. We need to make sure we set @Shizoqua can you ensure this? This is actually probably much better as we can add |
I will start working on it now |
|
Done — Feast CLI already configures logging via |
|
Good day @franciscojavierarceo |
|
Good day @franciscojavierarceo |
franciscojavierarceo
left a comment
There was a problem hiding this comment.
unit tests are failing, can you revise?
4c71c27 to
c309c53
Compare
corrected the requested reviews you gave |
|
Hello, |
|
need to fix tests and linter |
I'll work on that immediately |
2fb3c5a to
d8bed89
Compare
Done, I have worked on the tests and linter |
|
@Shizoqua can you provide screenshots of the CLI output before and after? Thanks a ton! |
Before Screenshot:
After Screenshot:
Here are the CLI outputs before & after. Command: Before (upstream/master): output uses print (no INFO:feast.feature_store banner) |
|
@Shizoqua Looking good now, please resolve the conflicts and we will merge |
d8bed89 to
e2062f2
Compare
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
🟡 1 issue in files not directly in the diff
🟡 Colorama ANSI escape codes embedded in logger.info() calls will produce garbled output in log files (sdk/python/feast/feature_store.py:1509-1511)
The PR's goal is to replace print() with logging to avoid writing to stdout from library code. However, the code still uses colorama's Style.BRIGHT + Fore.GREEN and Style.RESET_ALL ANSI escape codes inside logger.info() calls.
Click to expand
Problem
ANSI escape codes are only meaningful when output goes to a terminal that interprets them. When these logger.info() messages are written to:
- Log files
- Log aggregation systems (e.g., CloudWatch, Splunk)
- Non-TTY environments (CI/CD pipelines, Docker containers)
- Any handler that doesn't support ANSI codes
The output will contain raw escape sequences like \x1b[1m\x1b[32mfeature_view_name\x1b[0m instead of colored text.
Example of affected code at sdk/python/feast/feature_store.py:1509-1511:
logger.info(
f"{Style.BRIGHT + Fore.GREEN}{feature_view.name}{Style.RESET_ALL}:"
)Expected behavior
Log messages should be plain text without ANSI codes:
logger.info("%s:", feature_view.name)Impact
Log files and log aggregation systems will contain unreadable escape sequences, making logs harder to read and parse.
Recommendation: Remove colorama formatting from all logger.info() calls. Use plain text logging, e.g., logger.info("%s:", feature_view.name). Also remove the unused colorama import at line 37.
View issue and 6 additional flags in Devin Review.
I have corrected the conflicts. |
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com> Signed-off-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com>
Signed-off-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
d979b11 to
e5d6e6a
Compare


Summary
This PR removes direct
print()usage from Feast’s materialization flow and replaces it with standard library logging. This avoids writing to stdout from library code while still surfacing materialization progress and warnings via configured log handlers.Changes
print()calls in FeatureStore.materialize, materialize_incremental, and ODFV materialization helper logic withlogger.info/logger.warning.coloramaimport (Fore,Style) after eliminating colored stdout output.Testing
python -m compileall sdk/python/feast/feature_store.py