Debugging Guide#
Tips and strategies for debugging YT Framework pipelines.
Debugging Tips#
Enable Debug Logging#
Set log level to DEBUG:
from yt_framework.core.pipeline import DefaultPipeline
import logging
# In pipeline.py
if __name__ == "__main__":
DefaultPipeline.main()
Or set in code:
self.logger.setLevel(logging.DEBUG)
Check Dev Mode Files#
In dev mode, inspect generated files:
# Check tables
ls -la .dev/*.jsonl
# Check logs
cat .dev/operation.log
# Check sandbox
ls -la .dev/sandbox_*/
Review YT Web UI#
In prod mode, check YT web UI:
Navigate to operation
Review operation logs
Check job details
Inspect input/output tables
Test Locally First#
Always test in dev mode first:
pipeline:
mode: "dev"
Then switch to prod:
pipeline:
mode: "prod"
Check Configuration#
Validate configuration:
# Print config
print(OmegaConf.to_yaml(self.config))
# Check specific values
print(self.config.client.operations.map.input_table)
Review Logs#
Check logs for errors:
# In stage
self.logger.error("Error message", exc_info=True)
Review operation logs in YT web UI or .dev/ directory.
Getting Help#
Check Documentation#
Review relevant documentation sections
Check examples for similar patterns
Review API reference
Common Patterns#
Check examples directory for working code
Review similar pipelines
Look for common patterns
Error Messages#
Read error messages carefully
Check stack traces
Review operation logs
Community Support#
Check project issues
Review documentation
Ask for help with specific error messages
Prevention#
Best Practices#
Test locally: Always test in dev mode first
Validate configs: Check configuration before running
Handle errors: Add error handling in stages
Log progress: Use logging for debugging
Version control: Track code and config changes
Common Mistakes#
Wrong mode: Using prod mode for development
Missing configs: Forgetting required configuration
Path errors: Incorrect table or file paths
Resource limits: Insufficient resources allocated
Missing dependencies: Forgetting to install packages
Debug Mode#
Enable Debug Mode#
Set debug logging in pipeline:
from yt_framework.core.pipeline import DefaultPipeline
import logging
if __name__ == "__main__":
pipeline = DefaultPipeline(
config=config,
pipeline_dir=Path("."),
log_level=logging.DEBUG
)
pipeline.run()
Log Analysis#
Common log patterns to look for:
ERROR- Critical failuresWARNING- Potential issuesDEBUG- Detailed execution information
Common Error Codes#
ValueError- Configuration or parameter errorsFileNotFoundError- Missing files or tablesPermissionError- Access deniedRuntimeError- Operation execution failures
Next Steps#
Review Configuration Guide for config issues
Check Dev vs Prod for mode-specific issues
Explore Examples for working patterns
Review API Reference for detailed API information